Skip to content

Commit

Permalink
Add model test usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhu committed Nov 10, 2024
1 parent 5f05039 commit 38480fe
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -54,6 +54,33 @@
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To test the model client, you can use the following code:"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CreateResult(finish_reason='stop', content='The capital of France is Paris.', usage=RequestUsage(prompt_tokens=15, completion_tokens=7), cached=False, logprobs=None)\n"
]
}
],
"source": [
"from autogen_core.components.models import UserMessage\n",
"\n",
"result = await opneai_model_client.create([UserMessage(content=\"What is the capital of France?\", source=\"user\")])\n",
"print(result)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 38480fe

Please sign in to comment.