main module
- async main.generate_conversation_report(req: Request)
Function for POST on /conversation-report path of FastAPI server. This receive a chat-id parameter into the http payload, then compute and store a summary of the corresponding conversation into the database.
- Returns:
payload of the incoming request
- Return type:
dict
- main.make_printable(s)
Replace non-printable characters in a string.
- S:
string to make printable
- Returns:
printable string
- Return type:
str
- main.manage_incoming_message(chat_id, text, name)
Helper method to manage an incoming message to the server
- Text:
content of the message
- Text:
name of the user who wrote the message
- Returns:
a response computed using the chatgpt manager
- Return type:
str
- async main.root()
Function for GET on / path of FastAPI server
- Returns:
message if server is running
- Return type:
dict
- async main.telegram_webhook(req: Request)
Function for POST on /telegram path of FastAPI server. This receive an message for telegram server, it compute a response using chagpt and produce a response on /sendMessage versus Telegram servers.
- Returns:
payload of the incoming request
- Return type:
dict