fix logging

This commit is contained in:
if 2023-04-02 00:14:25 +03:00
parent 18b88b9029
commit 4ad96c3fc1

View File

@ -8,13 +8,11 @@ import streamlit as st
@st.cache_data()
def chat_gpt_request(ai_model: str, messages: List[dict]) -> dict:
openai.api_key = st.secrets.api_credentials.api_key
logging.warning("messages:")
logging.warning(messages)
logging.info(f"{messages=}")
completion = openai.ChatCompletion.create(
model=ai_model,
messages=messages,
# temperature=0.7,
)
logging.warning("completion:")
logging.warning(completion)
logging.info(f"{completion=}")
return completion