Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
simveit committed Dec 27, 2024
1 parent f676a0c commit 8de730e
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions _posts/2024-12-27-synthetic-data-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ resp = client.chat.completions.create(
messages=[
{
"role": "user",
"content": """Write a potential user query to a chatbot for the following product:
`{{ data }}`""",
"content": "Write a potential user query to a chatbot for the following product:\n{{ data }}"
},
],
response_model=SyntheticQuestion,
context={"data": client_description},
context={"data": client_description},
)

print(resp.chain_of_thought)
Expand Down Expand Up @@ -117,24 +116,30 @@ synthetic_question = client.chat.completions.create(
{
"role": "user",
"content": """We want to generate synthetic data to evaluate the capabilities of the chatbot of our client.
Client description:
`{{ client_description }}`
To generate high quality data you will first come up with a user type and craft a small background about the user.
You will then craft a query for that user. You will be given a topic that the query will be about.
You will also be given an example for a user type, background and question for better understanding:
Topic: {{ topic }}
```
Example type: {{ example_type }}
Example background: {{ example_background }}
Example query: {{ example_query }}
```
Please make sure that the question is on the topic. It is highly important the generate user type, background and query are about the topic.""",
Client description:
{{ client_description }}
To generate high quality data, you will first come up with a user type and craft a small background about the user.
You will then craft a query for that user. You will be given a topic that the query will be about.
You will also be given an example for a user type, background, and question for better understanding:
Topic: {{ topic }}
Example type: {{ example_type }}
Example background: {{ example_background }}
Example query: {{ example_query }}
Please make sure the question is on the topic. It is highly important to generate a user type, background, and query about the topic.
""",
},
],
response_model=SyntheticQuestion,
context={"client_description": client_description, "topic": profile["topic"],
"example_type": profile["example_type"], "example_background": profile["example_background"],
"example_query": profile["example_query"]},
context={
"client_description": client_description,
"topic": profile["topic"],
"example_type": profile["example_type"],
"example_background": profile["example_background"],
"example_query": profile["example_query"]
},
)

resp = Response(
Expand All @@ -149,6 +154,7 @@ print(profile["example_query"])
print(resp.synthetic_question.user_type)
print(resp.synthetic_question.user_background)
print(resp.synthetic_question.query)

# > Requesting an Additional Card
# > Roommate Sharing Bills
# > Iris splits rent and groceries with her roommate, hoping to consolidate spending on one card.
Expand Down

0 comments on commit 8de730e

Please sign in to comment.