chore: unpublish /inference/chat-completion

This commit is contained in:
Matthew Farrellee 2025-09-30 09:27:23 -04:00
parent 6cce553c93
commit b0e161d3db
23 changed files with 1448 additions and 2137 deletions

View file

@ -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 Models Response\n",
"\n",
"The `completion_message` contains the assistants 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 assistants 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')"
]
},
{