Created
May 29, 2025 02:35
-
-
Save jeanmidevacc/96dd750f8e046f1b47406b16caa0b37e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# definition of the few shot messages | |
messages_few_shots = [] | |
for key, sample in samples.items(): | |
messages_few_shots.extend([{ | |
"role": "user", | |
"content" : str(sample["input"]), | |
},{ | |
"role": "assistant", | |
"content" : str(sample["output"]), | |
} | |
]) | |
# Set the messages to send to the client | |
messages = messages_few_shots.copy() | |
messages.append({ | |
"role": "user", | |
"content" : raw_str_html, | |
}) | |
# Execute the completion | |
chat_response = client.chat.complete( | |
model = model, | |
messages = messages | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment