mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 04:04:14 +00:00
chore: unpublish /inference/chat-completion (#3609)
# What does this PR do?
BREAKING CHANGE: removes /inference/chat-completion route and updates
relevant documentation
## Test Plan
🤷
This commit is contained in:
parent
62e302613f
commit
cb33f45c11
23 changed files with 1448 additions and 2137 deletions
|
@ -152,8 +152,8 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"response = client.inference.chat_completion(\n",
|
||||
" messages=few_shot_examples, model_id=MODEL_NAME\n",
|
||||
"response = client.chat.completions.create(\n",
|
||||
" messages=few_shot_examples, model=MODEL_NAME\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
|
@ -164,7 +164,7 @@
|
|||
"source": [
|
||||
"#### 4. Display the Model’s Response\n",
|
||||
"\n",
|
||||
"The `completion_message` contains the assistant’s generated content based on the few-shot examples provided. Output this content to see the model's response directly in the console.\n"
|
||||
"The `choices[0].message.content` contains the assistant’s generated content based on the few-shot examples provided. Output this content to see the model's response directly in the console.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -184,7 +184,7 @@
|
|||
"source": [
|
||||
"from termcolor import cprint\n",
|
||||
"\n",
|
||||
"cprint(f'> Response: {response.completion_message.content}', 'cyan')"
|
||||
"cprint(f'> Response: {response.choices[0].message.content}', 'cyan')"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -219,7 +219,7 @@
|
|||
"\n",
|
||||
"client = LlamaStackClient(base_url=f'http://{HOST}:{PORT}')\n",
|
||||
"\n",
|
||||
"response = client.inference.chat_completion(\n",
|
||||
"response = client.chat.completions.create(\n",
|
||||
" messages=[\n",
|
||||
" {\"role\": \"user\", \"content\": 'Have shorter, spear-shaped ears.'},\n",
|
||||
" {\n",
|
||||
|
@ -253,10 +253,10 @@
|
|||
" \"content\": 'Generally taller and more robust, commonly seen as guard animals.'\n",
|
||||
" }\n",
|
||||
"],\n",
|
||||
" model_id=MODEL_NAME,\n",
|
||||
" model=MODEL_NAME,\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"cprint(f'> Response: {response.completion_message.content}', 'cyan')"
|
||||
"cprint(f'> Response: {response.choices[0].message.content}', 'cyan')"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue