Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
0
Share

OpenAiChat

Class to manage communication with OpenAI chat api

:return: description :rtype: type

Functions
__init__

Initialize self. See help(type(self)) for accurate signature.

system_prompt : str
messages : List
add_assistant_message
content : str
add_user_message
content : str
call_gpt
Return type : str
export_gpt_messages
Return type : List
get_last_assistant_message
extract_code : bool
Return type : Optional
get_last_message
Return type : Optional
get_messages
Return type : List
get_system_prompt
Return type : Optional
has_messages
Return type : bool
has_system_prompt
Return type : bool
last_message_is_user
Return type : bool
reset
set_system_prompt
system_prompt : str
to_json
Return type : OpenAiChatDict
extract_code_from_gpt_response @classmethod

Extract only the code from the GPT response.

gpt_response : str
_description_
Return type : str
from_json @classmethod
json : OpenAiChatDict
system_prompt : str
Return type : OpenAiChat
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.