From 8de730ecc866dc62ee1c906ad147cc99588c9ee6 Mon Sep 17 00:00:00 2001 From: Simon Veitner Date: Fri, 27 Dec 2024 19:57:41 +0100 Subject: [PATCH] update --- _posts/2024-12-27-synthetic-data-intro.md | 42 +++++++++++++---------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/_posts/2024-12-27-synthetic-data-intro.md b/_posts/2024-12-27-synthetic-data-intro.md index bfddc44..3e7375d 100644 --- a/_posts/2024-12-27-synthetic-data-intro.md +++ b/_posts/2024-12-27-synthetic-data-intro.md @@ -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) @@ -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( @@ -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.