mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 12:59:47 +00:00
.
This commit is contained in:
parent
f946d23d8e
commit
5a845cebfd
1 changed files with 14 additions and 19 deletions
9
2.py
9
2.py
|
|
@ -11,13 +11,9 @@ client = OpenAI(base_url="http://localhost:8000/v1", api_key="fake")
|
||||||
completion = client.chat.completions.create(
|
completion = client.chat.completions.create(
|
||||||
model="meta-llama/Llama-3.2-3B-Instruct",
|
model="meta-llama/Llama-3.2-3B-Instruct",
|
||||||
messages=[
|
messages=[
|
||||||
{
|
{"role": "user", "content": "Write me a haiku about coding"},
|
||||||
"role": "user",
|
|
||||||
"content": "Write me a haiku about coding",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
extra_body={
|
response_format={
|
||||||
"response_format": {
|
|
||||||
"type": "json_schema",
|
"type": "json_schema",
|
||||||
"json_schema": {
|
"json_schema": {
|
||||||
"name": "name_of_response_format",
|
"name": "name_of_response_format",
|
||||||
|
|
@ -32,7 +28,6 @@ completion = client.chat.completions.create(
|
||||||
},
|
},
|
||||||
"strict": True,
|
"strict": True,
|
||||||
},
|
},
|
||||||
}
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue