Giga Chat AI#

Processing and sending responses to requests to the AI model.#

Module of the GigaChatAI.

class gigachatai.BaseChatDialog(bot)[source]#

The class for Chat-Dialog function (Base Class-Sector).

Parameters:

bot (Bot) –

abstract async chat_dialog(message, state)[source]#

Basic Chat-Dialog function.

Parameters:
  • message (Message) – Message of user / query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

class gigachatai.BaseNewFSMContext(bot)[source]#

The base-class for create new state (FSM).

Parameters:

bot (Bot) –

abstract async chat_dialog(message, state)[source]#

Chat-Dialog function.

Parameters:
  • message (Message) – Message of user / query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

abstract async set(state)[source]#

Set state.

Parameters:

state (FSMContext) – FSM.

Returns:

None.

Return type:

None

class gigachatai.ChatDialogGigaVersionLight(bot)[source]#

The class for Chat-Dialog function (GigaLight V. dialog).

Parameters:

bot (Bot) –

async chat_dialog(message, state)[source]#

GLV Chat-Dialog function.

Parameters:
  • message (Message) – Message of user / query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

class gigachatai.ChatDialogGigaVersionPro(bot)[source]#

The class for Chat-Dialog function (GigaPro V. dialog).

Parameters:

bot (Bot) –

async chat_dialog(message, state)[source]#

GLV Chat-Dialog function.

Parameters:
  • message (Message) – Message of user / query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

class gigachatai.GigaChatAI(bot, call_query)[source]#

Class of the helper for the users and admin - GigaChat.

Parameters:
  • bot (Bot) –

  • call_query (CallbackQuery) –

async __chat_dialog_light(message, state)#

GLV Chat-Dialog function.

Parameters:
  • message (Message) – Message of user / query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __chat_dialog_pro(message, state)#

GPV Chat-Dialog function.

Parameters:
  • message (Message) – Message of user / query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __giga_version_1(call_query, state)#

Handler of the callback query by click on the btn1: LightVersion of GigaChat.

Parameters:
  • call_query (CallbackQuery) – Query (by click on the button) with callback.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __giga_version_2(call_query, state)#

Handler of the callback query by click on the btn1: PROVersion of GigaChat.

Parameters:
  • call_query (CallbackQuery) – Query (by click on the button) with callback.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async choosing_ai_model()[source]#

Choosing AI-Model (PRO/Light) before Chat-Dialog function.

Returns:

None.

Return type:

None

class gigachatai.NewFSMContextLight(bot)[source]#

The class for create new state (FSM) - GVL.

Parameters:

bot (Bot) –

async chat_dialog(message, state)[source]#

GLV Chat-Dialog function.

Parameters:
  • message (Message) – Message of user / query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async set(state)[source]#

Set state.

Parameters:

state (FSMContext) – FSM.

Returns:

None.

Return type:

None

class gigachatai.NewFSMContextPro(bot)[source]#

The class for create new state (FSM) - GVL.

Parameters:

bot (Bot) –

async chat_dialog(message, state)[source]#

GLV Chat-Dialog function.

Parameters:
  • message (Message) – Message of user / query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async set(state)[source]#

Set state.

Parameters:

state (FSMContext) – FSM.

Returns:

None.

Return type:

None