Skip to content

Instantly share code, notes, and snippets.

@jeanmidevacc
Created May 29, 2025 02:35
Show Gist options
  • Save jeanmidevacc/96dd750f8e046f1b47406b16caa0b37e to your computer and use it in GitHub Desktop.
Save jeanmidevacc/96dd750f8e046f1b47406b16caa0b37e to your computer and use it in GitHub Desktop.
# 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