Skip to content

Commit 8003088

Browse files
committed
3.sdk
1 parent 934a376 commit 8003088

File tree

421 files changed

+32902
-10313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

421 files changed

+32902
-10313
lines changed

MIA-schema.json

Lines changed: 394 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,394 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/hyper-schema#",
3+
"title": "Heroku Managed Inference and Agent API",
4+
"description": "API endpoints for generating conversational completions and vector embeddings using the Heroku Managed Inference and Agent add-on.",
5+
"definitions": {
6+
"chat_completions": {
7+
"links": [
8+
{
9+
"rel": "chat_completions",
10+
"href": "/v1/chat/completions",
11+
"method": "POST",
12+
"title": "Generate conversational completions",
13+
"schema": {
14+
"$ref": "#/definitions/chat_completions"
15+
}
16+
}
17+
],
18+
"type": "object",
19+
"properties": {
20+
"model": {
21+
"type": "string",
22+
"description": "The model used for completion. Typically, you'll use your INFERENCE_MODEL_ID config variable for this value.",
23+
"examples": [
24+
"claude-3-5-sonnet"
25+
]
26+
},
27+
"messages": {
28+
"type": "array",
29+
"description": "An array of message objects representing the conversation history.",
30+
"items": {
31+
"type": "object",
32+
"properties": {
33+
"role": {
34+
"type": "string",
35+
"enum": [
36+
"user",
37+
"assistant",
38+
"system",
39+
"tool"
40+
],
41+
"description": "The role of the message sender."
42+
},
43+
"content": {
44+
"type": [
45+
"string",
46+
"array"
47+
],
48+
"description": "The content of the message."
49+
},
50+
"refusal": {
51+
"type": [
52+
"string",
53+
"null"
54+
],
55+
"description": "A refusal message by the assistant."
56+
},
57+
"tool_calls": {
58+
"type": "array",
59+
"description": "Tool calls generated by the model.",
60+
"items": {
61+
"type": "object",
62+
"properties": {
63+
"id": {
64+
"type": "string",
65+
"description": "The ID of the tool call."
66+
},
67+
"type": {
68+
"type": "string",
69+
"enum": [
70+
"function",
71+
"heroku_tool"
72+
],
73+
"description": "The type of tool call."
74+
},
75+
"function": {
76+
"type": "object",
77+
"properties": {
78+
"name": {
79+
"type": "string",
80+
"description": "The name of the function to be called."
81+
},
82+
"arguments": {
83+
"type": "string",
84+
"description": "The arguments for the function call."
85+
}
86+
},
87+
"required": [
88+
"name",
89+
"arguments"
90+
]
91+
}
92+
},
93+
"required": [
94+
"id",
95+
"type",
96+
"function"
97+
]
98+
}
99+
},
100+
"tool_call_id": {
101+
"type": "string",
102+
"description": "The ID of the tool call that this message is responding to."
103+
}
104+
},
105+
"required": [
106+
"role",
107+
"content"
108+
]
109+
}
110+
},
111+
"max_tokens": {
112+
"type": "integer",
113+
"description": "The maximum number of tokens the model is allowed to generate before stopping.",
114+
"maximum": 4096,
115+
"default": 4096,
116+
"examples": [
117+
100
118+
]
119+
},
120+
"stop": {
121+
"type": "array",
122+
"description": "A list of strings where the model will stop generating further tokens once any of the strings is encountered in the response.",
123+
"items": {
124+
"type": "string"
125+
},
126+
"examples": [
127+
[
128+
"foo"
129+
]
130+
]
131+
},
132+
"stream": {
133+
"type": "boolean",
134+
"description": "Whether to stream responses incrementally via server-sent events.",
135+
"default": false,
136+
"examples": [
137+
true
138+
]
139+
},
140+
"system": {
141+
"type": "string",
142+
"description": "An optional system prompt used to provide additional context or set behavior for the model.",
143+
"examples": [
144+
"Be concise and avoid waffling."
145+
]
146+
},
147+
"temperature": {
148+
"type": "number",
149+
"description": "Controls the randomness of the response. Values closer to 0 make the response more focused, while values closer to 1.0 encourage more diverse responses.",
150+
"minimum": 0.0,
151+
"maximum": 1.0,
152+
"default": 1.0,
153+
"examples": [
154+
0.2
155+
]
156+
},
157+
"tool_choice": {
158+
"type": [
159+
"string",
160+
"object"
161+
],
162+
"description": "Specifies how the model should use the provided tools.",
163+
"oneOf": [
164+
{
165+
"type": "string",
166+
"enum": [
167+
"none",
168+
"auto",
169+
"required"
170+
]
171+
},
172+
{
173+
"type": "object",
174+
"properties": {
175+
"type": {
176+
"type": "string",
177+
"enum": [
178+
"function",
179+
"heroku_tool"
180+
]
181+
},
182+
"function": {
183+
"type": "object",
184+
"properties": {
185+
"name": {
186+
"type": "string",
187+
"description": "The name of the function to be called."
188+
}
189+
},
190+
"required": [
191+
"name"
192+
]
193+
}
194+
},
195+
"required": [
196+
"type",
197+
"function"
198+
]
199+
}
200+
],
201+
"default": {
202+
"type": "auto",
203+
"disable_parallel_tool_use": false
204+
},
205+
"examples": [
206+
{
207+
"type": "any"
208+
}
209+
]
210+
},
211+
"tools": {
212+
"type": "array",
213+
"description": "The tools that the model may call.",
214+
"items": {
215+
"type": "object",
216+
"properties": {
217+
"type": {
218+
"type": "string",
219+
"enum": [
220+
"function",
221+
"heroku_tool"
222+
]
223+
},
224+
"function": {
225+
"type": "object",
226+
"properties": {
227+
"name": {
228+
"type": "string",
229+
"description": "The name of the function to be called."
230+
},
231+
"description": {
232+
"type": "string",
233+
"description": "A description of what the function does."
234+
},
235+
"parameters": {
236+
"type": "object",
237+
"description": "The parameters the function accepts, described as a JSON Schema object."
238+
}
239+
},
240+
"required": [
241+
"name",
242+
"description",
243+
"parameters"
244+
]
245+
}
246+
},
247+
"required": [
248+
"type",
249+
"function"
250+
]
251+
},
252+
"examples": [
253+
[
254+
{
255+
"type": "function",
256+
"function": {
257+
"name": "get_current_weather",
258+
"description": "Get the current weather in a given location",
259+
"parameters": {
260+
"type": "object",
261+
"properties": {
262+
"location": {
263+
"type": "string",
264+
"description": "The city and state, e.g. Portland, OR"
265+
}
266+
},
267+
"required": [
268+
"location"
269+
]
270+
}
271+
}
272+
}
273+
]
274+
]
275+
},
276+
"top_p": {
277+
"type": "number",
278+
"description": "Specifies the proportion of tokens to consider when generating the next token, in terms of cumulative probability.",
279+
"minimum": 0.0,
280+
"maximum": 1.0,
281+
"default": 0.999,
282+
"examples": [
283+
0.95
284+
]
285+
}
286+
},
287+
"required": [
288+
"model",
289+
"messages"
290+
]
291+
},
292+
"embeddings": {
293+
"links": [
294+
{
295+
"rel": "embeddings",
296+
"href": "/v1/embeddings",
297+
"method": "POST",
298+
"title": "Generate vector embeddings",
299+
"schema": {
300+
"$ref": "#/definitions/embeddings"
301+
}
302+
}
303+
],
304+
"type": "object",
305+
"properties": {
306+
"model": {
307+
"type": "string",
308+
"description": "ID of the embedding model to use.",
309+
"examples": [
310+
"cohere-embed-multilingual"
311+
]
312+
},
313+
"input": {
314+
"type": "array",
315+
"description": "An array of strings (up to 96) for the model to embed. Recommended length is less than 512 tokens per string.",
316+
"items": {
317+
"type": "string"
318+
},
319+
"examples": [
320+
[
321+
"example string 1",
322+
"example string 2"
323+
]
324+
]
325+
},
326+
"input_type": {
327+
"type": "string",
328+
"description": "Specifies the type of input passed to the model. Prepends special tokens to the input.",
329+
"enum": [
330+
"search_document",
331+
"search_query",
332+
"classification",
333+
"clustering"
334+
],
335+
"default": "search_document",
336+
"examples": [
337+
"search_query"
338+
]
339+
},
340+
"encoding_format": {
341+
"type": "string",
342+
"description": "Determines the encoding format of the output.",
343+
"enum": [
344+
"raw",
345+
"base64"
346+
],
347+
"default": "raw",
348+
"examples": [
349+
"base64"
350+
]
351+
},
352+
"embedding_type": {
353+
"type": "string",
354+
"description": "Specifies the type(s) of embeddings to return.",
355+
"enum": [
356+
"float",
357+
"int8",
358+
"uint8",
359+
"binary",
360+
"ubinary"
361+
],
362+
"default": "float",
363+
"examples": [
364+
"int8"
365+
]
366+
}
367+
},
368+
"required": [
369+
"model",
370+
"input"
371+
]
372+
}
373+
},
374+
"links": [
375+
{
376+
"rel": "chat_completions",
377+
"href": "/v1/chat/completions",
378+
"method": "POST",
379+
"title": "Generate conversational completions",
380+
"schema": {
381+
"$ref": "#/definitions/chat_completions"
382+
}
383+
},
384+
{
385+
"rel": "embeddings",
386+
"href": "/v1/embeddings",
387+
"method": "POST",
388+
"title": "Generate vector embeddings",
389+
"schema": {
390+
"$ref": "#/definitions/embeddings"
391+
}
392+
}
393+
]
394+
}

0 commit comments

Comments
 (0)