Skip to content

Commit c89db10

Browse files
Completes chat completion inference endpoint docs (#4451) (#4528)
* Completes chat completion inference endpoint docs. * Fixes format. (cherry picked from commit 34d1af8) Co-authored-by: István Zoltán Szabó <szabosteve@gmail.com>
1 parent 1f197b5 commit c89db10

File tree

2 files changed

+75
-4
lines changed

2 files changed

+75
-4
lines changed

specification/inference/_types/CommonTypes.ts

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,47 @@ export class RequestChatCompletion {
4747
temperature?: float
4848
/**
4949
* Controls which tool is called by the model.
50+
* String representation: One of `auto`, `none`, or `requrired`. `auto` allows the model to choose between calling tools and generating a message. `none` causes the model to not call any tools. `required` forces the model to call one or more tools.
51+
* Example (object representation):
52+
* ```
53+
* {
54+
* "tool_choice": {
55+
* "type": "function",
56+
* "function": {
57+
* "name": "get_current_weather"
58+
* }
59+
* }
60+
* }
61+
* ```
5062
*/
5163
tool_choice?: CompletionToolType
5264
/**
5365
* A list of tools that the model can call.
66+
* Example:
67+
* ```
68+
* {
69+
* "tools": [
70+
* {
71+
* "type": "function",
72+
* "function": {
73+
* "name": "get_price_of_item",
74+
* "description": "Get the current price of an item",
75+
* "parameters": {
76+
* "type": "object",
77+
* "properties": {
78+
* "item": {
79+
* "id": "12345"
80+
* },
81+
* "unit": {
82+
* "type": "currency"
83+
* }
84+
* }
85+
* }
86+
* }
87+
* }
88+
* ]
89+
* }
90+
* ```
5491
*/
5592
tools?: Array<CompletionTool>
5693
/**
@@ -140,18 +177,52 @@ export type MessageContent = string | Array<ContentObject>
140177
export interface Message {
141178
/**
142179
* The content of the message.
180+
*
181+
* String example:
182+
* ```
183+
* {
184+
* "content": "Some string"
185+
* }
186+
* ```
187+
*
188+
* Object example:
189+
* ```
190+
* {
191+
* "content": [
192+
* {
193+
* "text": "Some text",
194+
* "type": "text"
195+
* }
196+
* ]
197+
* }
198+
* ```
143199
*/
144200
content?: MessageContent
145201
/**
146-
* The role of the message author.
202+
* The role of the message author. Valid values are `user`, `assistant`, `system`, and `tool`.
147203
*/
148204
role: string
149205
/**
150-
* The tool call that this message is responding to.
206+
* Only for `tool` role messages. The tool call that this message is responding to.
151207
*/
152208
tool_call_id?: Id
153209
/**
154-
* The tool calls generated by the model.
210+
* Only for `assistant` role messages. The tool calls generated by the model. If it's specified, the `content` field is optional.
211+
* Example:
212+
* ```
213+
* {
214+
* "tool_calls": [
215+
* {
216+
* "id": "call_KcAjWtAww20AihPHphUh46Gd",
217+
* "type": "function",
218+
* "function": {
219+
* "name": "get_current_weather",
220+
* "arguments": "{\"location\":\"Boston, MA\"}"
221+
* }
222+
* }
223+
* ]
224+
* }
225+
* ```
155226
*/
156227
tool_calls?: Array<ToolCall>
157228
}

specification/inference/put_amazonbedrock/PutAmazonBedrockRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { InferenceChunkingSettings } from '@inference/_types/Services'
3030
/**
3131
* Create an Amazon Bedrock inference endpoint.
3232
*
33-
* Creates an inference endpoint to perform an inference task with the `amazonbedrock` service.
33+
* Create an inference endpoint to perform an inference task with the `amazonbedrock` service.
3434
*
3535
* >info
3636
* > You need to provide the access and secret keys only once, during the inference model creation. The get inference API does not retrieve your access or secret keys. After creating the inference model, you cannot change the associated key pairs. If you want to use a different access and secret key pair, delete the inference model and recreate it with the same name and the updated keys.

0 commit comments

Comments
 (0)