MCPcopy Index your code
hub / github.com/caesarHQ/textSQL / get_assistant_message

Function get_assistant_message

byod/api/app/utils.py:48–62  ·  view source on GitHub ↗
(
        messages: List[Dict[str, str]],
        temperature: int = 0,
        model: str = "gpt-3.5-0301",
        # model: str = "gpt-3.5-turbo",
        # model: str = "gpt-4",
)

Source from the content-addressed store, hash-verified

46
47
48def get_assistant_message(
49 messages: List[Dict[str, str]],
50 temperature: int = 0,
51 model: str = "gpt-3.5-0301",
52 # model: str = "gpt-3.5-turbo",
53 # model: str = "gpt-4",
54):
55 res = openai.ChatCompletion.create(
56 model=model,
57 temperature=temperature,
58 messages=messages
59 )
60 # completion = res['choices'][0]["message"]["content"]
61 assistant_message = res['choices'][0]
62 return assistant_message
63
64
65def clean_message_content(assistant_message_content):

Callers 5

get_sql_explanationFunction · 0.85
get_vega_lite_specFunction · 0.85
get_changed_vegaFunction · 0.85
text_to_sql_with_retryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected