MCPcopy Create free account
hub / github.com/caesarHQ/textSQL / get_few_shot_messages

Function get_few_shot_messages

byod/api/app/utils.py:31–45  ·  view source on GitHub ↗
(mode: str = "text_to_sql")

Source from the content-addressed store, hash-verified

29
30
31def get_few_shot_messages(mode: str = "text_to_sql") -> List[Dict]:
32 global IN_CONTEXT_EXAMPLES_DICT
33
34 examples = IN_CONTEXT_EXAMPLES_DICT.get(mode, [])
35 messages = []
36 for example in examples:
37 messages.append({
38 "role": "user",
39 "content": example["user"],
40 })
41 messages.append({
42 "role": "assistant",
43 "content": example["assistant"],
44 })
45 return messages
46
47
48def get_assistant_message(

Calls

no outgoing calls

Tested by

no test coverage detected