Elffuss BraidHub

kikocis/llama-stack public

Remove request wrapper migration (#64)

* [1/n] migrate inference/chat_completion

* migrate inference/completion

* inference/completion

* inference regenerate openapi spec

* safety api

* migrate agentic system

* migrate apis without implementations

* re-generate openapi spec

* remove hack from openapi generator

* fix inference

* fix inference

* openapi generator rerun

* Simplified Telemetry API and tying it to logger (#57)

* Simplified Telemetry API and tying it to logger

* small update which adds a METRIC type

* move span events one level down into structured log events

---------

Co-authored-by: Ashwin Bharambe <ashwin@meta.com>

* fix api to work with openapi generator

* fix agentic calling inference

* together adapter inference

* update inference adapters

---------

Co-authored-by: Ashwin Bharambe <ashwin.bharambe@gmail.com>
Co-authored-by: Ashwin Bharambe <ashwin@meta.com>
Changesetf342ccdd2224aee53e7966f394c986748d41cc6fc3fe3c68d4448dad128877b5
AuthorXi Yan <xiyan@meta.com> · 2024-09-12 15:03 -07:00
CommitterGitHub <noreply@github.com> · 2024-09-12 15:03 -07:00
Parents63314e75ef83

Browse the files at this changeset

26 files changed

modified llama_toolchain/agentic_system/api/api.py +10 −1
@@ -416,7 +416,16 @@
416416 @webmethod(route="/agentic_system/turn/create")
417417 async def create_agentic_system_turn(
418418 self,
419- request: AgenticSystemTurnCreateRequest,
419+ agent_id: str,
420+ session_id: str,
421+ messages: List[
422+ Union[
423+ UserMessage,
424+ ToolResponseMessage,
425+ ]
426+ ],
427+ attachments: Optional[List[Attachment]] = None,
428+ stream: Optional[bool] = False,
420429 ) -> AgenticSystemTurnResponseStreamChunk: ...
421430
422431 @webmethod(route="/agentic_system/turn/get")
modified llama_toolchain/agentic_system/client.py +1 −3
@@ -73,9 +73,7 @@
7373 async with client.stream(
7474 "POST",
7575 f"{self.base_url}/agentic_system/turn/create",
76- json={
77- "request": encodable_dict(request),
78- },
76+ json=encodable_dict(request),
7977 headers={"Content-Type": "application/json"},
8078 timeout=20,
8179 ) as response:
modified llama_toolchain/agentic_system/meta_reference/agent_instance.py +7 −9
@@ -388,19 +388,17 @@
388388 )
389389 )
390390
391- req = ChatCompletionRequest(
392- model=self.agent_config.model,
393- messages=input_messages,
391+ tool_calls = []
392+ content = ""
393+ stop_reason = None
394+ async for chunk in self.inference_api.chat_completion(
395+ self.agent_config.model,
396+ input_messages,
394397 tools=self._get_tools(),
395398 tool_prompt_format=self.agent_config.tool_prompt_format,
396399 stream=True,
397400 sampling_params=sampling_params,
398- )
399-
400- tool_calls = []
401- content = ""
402- stop_reason = None
403- async for chunk in self.inference_api.chat_completion(req):
401+ ):
404402 event = chunk.event
405403 if event.event_type == ChatCompletionResponseEventType.start:
406404 continue
modified llama_toolchain/agentic_system/meta_reference/agentic_system.py +19 −1
@@ -114,8 +114,26 @@
114114
115115 async def create_agentic_system_turn(
116116 self,
117- request: AgenticSystemTurnCreateRequest,
117+ agent_id: str,
118+ session_id: str,
119+ messages: List[
120+ Union[
121+ UserMessage,
122+ ToolResponseMessage,
123+ ]
124+ ],
125+ attachments: Optional[List[Attachment]] = None,
126+ stream: Optional[bool] = False,
118127 ) -> AsyncGenerator:
128+ # wrapper request to make it easier to pass around (internal only, not exposed to API)
129+ request = AgenticSystemTurnCreateRequest(
130+ agent_id=agent_id,
131+ session_id=session_id,
132+ messages=messages,
133+ attachments=attachments,
134+ stream=stream,
135+ )
136+
119137 agent_id = request.agent_id
120138 assert agent_id in AGENT_INSTANCES_BY_ID, f"System {agent_id} not found"
121139 agent = AGENT_INSTANCES_BY_ID[agent_id]
modified llama_toolchain/batch_inference/api/api.py +12 −2
@@ -51,11 +51,21 @@
5151 @webmethod(route="/batch_inference/completion")
5252 async def batch_completion(
5353 self,
54- request: BatchCompletionRequest,
54+ model: str,
55+ content_batch: List[InterleavedTextMedia],
56+ sampling_params: Optional[SamplingParams] = SamplingParams(),
57+ logprobs: Optional[LogProbConfig] = None,
5558 ) -> BatchCompletionResponse: ...
5659
5760 @webmethod(route="/batch_inference/chat_completion")
5861 async def batch_chat_completion(
5962 self,
60- request: BatchChatCompletionRequest,
63+ model: str,
64+ messages_batch: List[List[Message]],
65+ sampling_params: Optional[SamplingParams] = SamplingParams(),
66+ # zero-shot tool definitions as input to the model
67+ tools: Optional[List[ToolDefinition]] = list,
68+ tool_choice: Optional[ToolChoice] = ToolChoice.auto,
69+ tool_prompt_format: Optional[ToolPromptFormat] = ToolPromptFormat.json,
70+ logprobs: Optional[LogProbConfig] = None,
6171 ) -> BatchChatCompletionResponse: ...
modified llama_toolchain/dataset/api/api.py +2 −1
@@ -46,7 +46,8 @@
4646 @webmethod(route="/datasets/create")
4747 def create_dataset(
4848 self,
49- request: CreateDatasetRequest,
49+ uuid: str,
50+ dataset: TrainEvalDataset,
5051 ) -> None: ...
5152
5253 @webmethod(route="/datasets/get")
modified llama_toolchain/evaluations/api/api.py +3 −3
@@ -86,19 +86,19 @@
8686 @webmethod(route="/evaluate/text_generation/")
8787 def evaluate_text_generation(
8888 self,
89- request: EvaluateTextGenerationRequest,
89+ metrics: List[TextGenerationMetric],
9090 ) -> EvaluationJob: ...
9191
9292 @webmethod(route="/evaluate/question_answering/")
9393 def evaluate_question_answering(
9494 self,
95- request: EvaluateQuestionAnsweringRequest,
95+ metrics: List[QuestionAnsweringMetric],
9696 ) -> EvaluationJob: ...
9797
9898 @webmethod(route="/evaluate/summarization/")
9999 def evaluate_summarization(
100100 self,
101- request: EvaluateSummarizationRequest,
101+ metrics: List[SummarizationMetric],
102102 ) -> EvaluationJob: ...
103103
104104 @webmethod(route="/evaluate/jobs")
modified llama_toolchain/inference/adapters/fireworks/fireworks.py +22 −1
@@ -76,7 +76,28 @@
7676
7777 return options
7878
79- async def chat_completion(self, request: ChatCompletionRequest) -> AsyncGenerator:
79+ async def chat_completion(
80+ self,
81+ model: str,
82+ messages: List[Message],
83+ sampling_params: Optional[SamplingParams] = SamplingParams(),
84+ tools: Optional[List[ToolDefinition]] = list(),
85+ tool_choice: Optional[ToolChoice] = ToolChoice.auto,
86+ tool_prompt_format: Optional[ToolPromptFormat] = ToolPromptFormat.json,
87+ stream: Optional[bool] = False,
88+ logprobs: Optional[LogProbConfig] = None,
89+ ) -> AsyncGenerator:
90+ request = ChatCompletionRequest(
91+ model=model,
92+ messages=messages,
93+ sampling_params=sampling_params,
94+ tools=tools,
95+ tool_choice=tool_choice,
96+ tool_prompt_format=tool_prompt_format,
97+ stream=stream,
98+ logprobs=logprobs,
99+ )
100+
80101 messages = prepare_messages(request)
81102
82103 # accumulate sampling params and other options to pass to fireworks
modified llama_toolchain/inference/adapters/ollama/ollama.py +22 −1
@@ -84,7 +84,28 @@
8484
8585 return options
8686
87- async def chat_completion(self, request: ChatCompletionRequest) -> AsyncGenerator:
87+ async def chat_completion(
88+ self,
89+ model: str,
90+ messages: List[Message],
91+ sampling_params: Optional[SamplingParams] = SamplingParams(),
92+ tools: Optional[List[ToolDefinition]] = list(),
93+ tool_choice: Optional[ToolChoice] = ToolChoice.auto,
94+ tool_prompt_format: Optional[ToolPromptFormat] = ToolPromptFormat.json,
95+ stream: Optional[bool] = False,
96+ logprobs: Optional[LogProbConfig] = None,
97+ ) -> AsyncGenerator:
98+ request = ChatCompletionRequest(
99+ model=model,
100+ messages=messages,
101+ sampling_params=sampling_params,
102+ tools=tools,
103+ tool_choice=tool_choice,
104+ tool_prompt_format=tool_prompt_format,
105+ stream=stream,
106+ logprobs=logprobs,
107+ )
108+
88109 messages = prepare_messages(request)
89110 # accumulate sampling params and other options to pass to ollama
90111 options = self.get_ollama_chat_options(request)
modified llama_toolchain/inference/adapters/tgi/tgi.py +22 −1
@@ -82,7 +82,28 @@
8282
8383 return options
8484
85- async def chat_completion(self, request: ChatCompletionRequest) -> AsyncGenerator:
85+ async def chat_completion(
86+ self,
87+ model: str,
88+ messages: List[Message],
89+ sampling_params: Optional[SamplingParams] = SamplingParams(),
90+ tools: Optional[List[ToolDefinition]] = list(),
91+ tool_choice: Optional[ToolChoice] = ToolChoice.auto,
92+ tool_prompt_format: Optional[ToolPromptFormat] = ToolPromptFormat.json,
93+ stream: Optional[bool] = False,
94+ logprobs: Optional[LogProbConfig] = None,
95+ ) -> AsyncGenerator:
96+ request = ChatCompletionRequest(
97+ model=model,
98+ messages=messages,
99+ sampling_params=sampling_params,
100+ tools=tools,
101+ tool_choice=tool_choice,
102+ tool_prompt_format=tool_prompt_format,
103+ stream=stream,
104+ logprobs=logprobs,
105+ )
106+
86107 messages = prepare_messages(request)
87108 model_input = self.formatter.encode_dialog_prompt(messages)
88109 prompt = self.tokenizer.decode(model_input.tokens)
modified llama_toolchain/inference/adapters/together/together.py +23 −1
@@ -76,7 +76,29 @@
7676
7777 return options
7878
79- async def chat_completion(self, request: ChatCompletionRequest) -> AsyncGenerator:
79+ async def chat_completion(
80+ self,
81+ model: str,
82+ messages: List[Message],
83+ sampling_params: Optional[SamplingParams] = SamplingParams(),
84+ tools: Optional[List[ToolDefinition]] = list(),
85+ tool_choice: Optional[ToolChoice] = ToolChoice.auto,
86+ tool_prompt_format: Optional[ToolPromptFormat] = ToolPromptFormat.json,
87+ stream: Optional[bool] = False,
88+ logprobs: Optional[LogProbConfig] = None,
89+ ) -> AsyncGenerator:
90+ # wrapper request to make it easier to pass around (internal only, not exposed to API)
91+ request = ChatCompletionRequest(
92+ model=model,
93+ messages=messages,
94+ sampling_params=sampling_params,
95+ tools=tools,
96+ tool_choice=tool_choice,
97+ tool_prompt_format=tool_prompt_format,
98+ stream=stream,
99+ logprobs=logprobs,
100+ )
101+
80102 # accumulate sampling params and other options to pass to together
81103 options = self.get_together_chat_options(request)
82104 together_model = self.resolve_together_model(request.model)
modified llama_toolchain/inference/api/api.py +20 −2
@@ -85,6 +85,8 @@
8585
8686 @json_schema_type
8787 class CompletionResponse(BaseModel):
88+ """Completion response."""
89+
8890 completion_message: CompletionMessage
8991 logprobs: Optional[List[TokenLogProbs]] = None
9092
@@ -108,6 +110,8 @@
108110
109111 @json_schema_type
110112 class BatchCompletionResponse(BaseModel):
113+ """Batch completion response."""
114+
111115 completion_message_batch: List[CompletionMessage]
112116
113117
@@ -137,6 +141,8 @@
137141
138142 @json_schema_type
139143 class ChatCompletionResponse(BaseModel):
144+ """Chat completion response."""
145+
140146 completion_message: CompletionMessage
141147 logprobs: Optional[List[TokenLogProbs]] = None
142148
@@ -170,13 +176,25 @@
170176 @webmethod(route="/inference/completion")
171177 async def completion(
172178 self,
173- request: CompletionRequest,
179+ model: str,
180+ content: InterleavedTextMedia,
181+ sampling_params: Optional[SamplingParams] = SamplingParams(),
182+ stream: Optional[bool] = False,
183+ logprobs: Optional[LogProbConfig] = None,
174184 ) -> Union[CompletionResponse, CompletionResponseStreamChunk]: ...
175185
176186 @webmethod(route="/inference/chat_completion")
177187 async def chat_completion(
178188 self,
179- request: ChatCompletionRequest,
189+ model: str,
190+ messages: List[Message],
191+ sampling_params: Optional[SamplingParams] = SamplingParams(),
192+ # zero-shot tool definitions as input to the model
193+ tools: Optional[List[ToolDefinition]] = list,
194+ tool_choice: Optional[ToolChoice] = ToolChoice.auto,
195+ tool_prompt_format: Optional[ToolPromptFormat] = ToolPromptFormat.json,
196+ stream: Optional[bool] = False,
197+ logprobs: Optional[LogProbConfig] = None,
180198 ) -> Union[ChatCompletionResponse, ChatCompletionResponseStreamChunk]: ...
181199
182200 @webmethod(route="/inference/embeddings")
modified llama_toolchain/inference/client.py +3 −5
@@ -10,10 +10,10 @@
1010
1111 import fire
1212 import httpx
13-from pydantic import BaseModel
14-from termcolor import cprint
1513
1614 from llama_toolchain.core.datatypes import RemoteProviderConfig
15+from pydantic import BaseModel
16+from termcolor import cprint
1717
1818 from .api import (
1919 ChatCompletionRequest,
@@ -52,9 +52,7 @@
5252 async with client.stream(
5353 "POST",
5454 f"{self.base_url}/inference/chat_completion",
55- json={
56- "request": encodable_dict(request),
57- },
55+ json=encodable_dict(request),
5856 headers={"Content-Type": "application/json"},
5957 timeout=20,
6058 ) as response:
modified llama_toolchain/inference/meta_reference/inference.py +24 −1
@@ -22,9 +22,12 @@
2222 ToolCallParseStatus,
2323 )
2424 from llama_toolchain.inference.prepare_messages import prepare_messages
25+
2526 from .config import MetaReferenceImplConfig
2627 from .model_parallel import LlamaModelParallelGenerator
2728
29+from llama_models.llama3.api.datatypes import * # noqa: F403
30+from llama_toolchain.inference.api import * # noqa: F403
2831
2932 # there's a single model parallel process running serving the model. for now,
3033 # we don't support multiple concurrent requests to this process.
@@ -50,10 +53,30 @@
5053 # hm, when stream=False, we should not be doing SSE :/ which is what the
5154 # top-level server is going to do. make the typing more specific here
5255 async def chat_completion(
53- self, request: ChatCompletionRequest
56+ self,
57+ model: str,
58+ messages: List[Message],
59+ sampling_params: Optional[SamplingParams] = SamplingParams(),
60+ tools: Optional[List[ToolDefinition]] = list(),
61+ tool_choice: Optional[ToolChoice] = ToolChoice.auto,
62+ tool_prompt_format: Optional[ToolPromptFormat] = ToolPromptFormat.json,
63+ stream: Optional[bool] = False,
64+ logprobs: Optional[LogProbConfig] = None,
5465 ) -> AsyncIterator[
5566 Union[ChatCompletionResponseStreamChunk, ChatCompletionResponse]
5667 ]:
68+ # wrapper request to make it easier to pass around (internal only, not exposed to API)
69+ request = ChatCompletionRequest(
70+ model=model,
71+ messages=messages,
72+ sampling_params=sampling_params,
73+ tools=tools,
74+ tool_choice=tool_choice,
75+ tool_prompt_format=tool_prompt_format,
76+ stream=stream,
77+ logprobs=logprobs,
78+ )
79+
5780 messages = prepare_messages(request)
5881 model = resolve_model(request.model)
5982 if model is None:
modified llama_toolchain/post_training/api/api.py +22 −2
@@ -179,13 +179,33 @@
179179 @webmethod(route="/post_training/supervised_fine_tune")
180180 def supervised_fine_tune(
181181 self,
182- request: PostTrainingSFTRequest,
182+ job_uuid: str,
183+ model: str,
184+ dataset: TrainEvalDataset,
185+ validation_dataset: TrainEvalDataset,
186+ algorithm: FinetuningAlgorithm,
187+ algorithm_config: Union[
188+ LoraFinetuningConfig, QLoraFinetuningConfig, DoraFinetuningConfig
189+ ],
190+ optimizer_config: OptimizerConfig,
191+ training_config: TrainingConfig,
192+ hyperparam_search_config: Dict[str, Any],
193+ logger_config: Dict[str, Any],
183194 ) -> PostTrainingJob: ...
184195
185196 @webmethod(route="/post_training/preference_optimize")
186197 def preference_optimize(
187198 self,
188- request: PostTrainingRLHFRequest,
199+ job_uuid: str,
200+ finetuned_model: URL,
201+ dataset: TrainEvalDataset,
202+ validation_dataset: TrainEvalDataset,
203+ algorithm: RLHFAlgorithm,
204+ algorithm_config: Union[DPOAlignmentConfig],
205+ optimizer_config: OptimizerConfig,
206+ training_config: TrainingConfig,
207+ hyperparam_search_config: Dict[str, Any],
208+ logger_config: Dict[str, Any],
189209 ) -> PostTrainingJob: ...
190210
191211 @webmethod(route="/post_training/jobs")
modified llama_toolchain/reward_scoring/api/api.py +2 −1
@@ -50,5 +50,6 @@
5050 @webmethod(route="/reward_scoring/score")
5151 def reward_score(
5252 self,
53- request: RewardScoringRequest,
53+ dialog_generations: List[DialogGenerations],
54+ model: str,
5455 ) -> Union[RewardScoringResponse]: ...
modified llama_toolchain/safety/api/api.py +2 −1
@@ -86,5 +86,6 @@
8686 @webmethod(route="/safety/run_shields")
8787 async def run_shields(
8888 self,
89- request: RunShieldRequest,
89+ messages: List[Message],
90+ shields: List[ShieldDefinition],
9091 ) -> RunShieldResponse: ...
modified llama_toolchain/safety/client.py +3 −5
@@ -13,10 +13,10 @@
1313 import httpx
1414
1515 from llama_models.llama3.api.datatypes import UserMessage
16-from pydantic import BaseModel
17-from termcolor import cprint
1816
1917 from llama_toolchain.core.datatypes import RemoteProviderConfig
18+from pydantic import BaseModel
19+from termcolor import cprint
2020
2121 from .api import * # noqa: F403
2222
@@ -43,9 +43,7 @@
4343 async with httpx.AsyncClient() as client:
4444 response = await client.post(
4545 f"{self.base_url}/safety/run_shields",
46- json={
47- "request": encodable_dict(request),
48- },
46+ json=encodable_dict(request),
4947 headers={"Content-Type": "application/json"},
5048 timeout=20,
5149 )
modified llama_toolchain/safety/meta_reference/safety.py +4 −5
@@ -52,13 +52,12 @@
5252
5353 async def run_shields(
5454 self,
55- request: RunShieldRequest,
55+ messages: List[Message],
56+ shields: List[ShieldDefinition],
5657 ) -> RunShieldResponse:
57- shields = [shield_config_to_shield(c, self.config) for c in request.shields]
58+ shields = [shield_config_to_shield(c, self.config) for c in shields]
5859
59- responses = await asyncio.gather(
60- *[shield.run(request.messages) for shield in shields]
61- )
60+ responses = await asyncio.gather(*[shield.run(messages) for shield in shields])
6261
6362 return RunShieldResponse(responses=responses)
6463
modified llama_toolchain/synthetic_data_generation/api/api.py +3 −1
@@ -48,5 +48,7 @@
4848 @webmethod(route="/synthetic_data_generation/generate")
4949 def synthetic_data_generate(
5050 self,
51- request: SyntheticDataGenerationRequest,
51+ dialogs: List[Message],
52+ filtering_function: FilteringFunction = FilteringFunction.none,
53+ model: Optional[str] = None,
5254 ) -> Union[SyntheticDataGenerationResponse]: ...
modified llama_toolchain/telemetry/api/api.py +1 −1
@@ -125,7 +125,7 @@
125125
126126 class Telemetry(Protocol):
127127 @webmethod(route="/telemetry/log_event")
128- async def log_event(self, event: Event): ...
128+ async def log_event(self, event: Event) -> None: ...
129129
130130 @webmethod(route="/telemetry/get_trace", method="GET")
131131 async def get_trace(self, trace_id: str) -> Trace: ...
modified rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.html +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified rfcs/RFC-0001-llama-stack-assets/llama-stack-spec.yaml +388 −1176
@@ -180,180 +180,6 @@
180180 required:
181181 - step
182182 type: object
183- AgenticSystemTurnCreateRequest:
184- additionalProperties: false
185- properties:
186- agent_id:
187- type: string
188- attachments:
189- items:
190- $ref: '#/components/schemas/Attachment'
191- type: array
192- input_shields:
193- items:
194- $ref: '#/components/schemas/ShieldDefinition'
195- type: array
196- instructions:
197- type: string
198- messages:
199- items:
200- oneOf:
201- - $ref: '#/components/schemas/UserMessage'
202- - $ref: '#/components/schemas/ToolResponseMessage'
203- type: array
204- output_shields:
205- items:
206- $ref: '#/components/schemas/ShieldDefinition'
207- type: array
208- sampling_params:
209- $ref: '#/components/schemas/SamplingParams'
210- session_id:
211- type: string
212- stream:
213- type: boolean
214- tool_choice:
215- $ref: '#/components/schemas/ToolChoice'
216- tool_prompt_format:
217- $ref: '#/components/schemas/ToolPromptFormat'
218- tools:
219- items:
220- oneOf:
221- - $ref: '#/components/schemas/SearchToolDefinition'
222- - $ref: '#/components/schemas/WolframAlphaToolDefinition'
223- - $ref: '#/components/schemas/PhotogenToolDefinition'
224- - $ref: '#/components/schemas/CodeInterpreterToolDefinition'
225- - $ref: '#/components/schemas/FunctionCallToolDefinition'
226- - additionalProperties: false
227- properties:
228- input_shields:
229- items:
230- $ref: '#/components/schemas/ShieldDefinition'
231- type: array
232- max_chunks:
233- type: integer
234- max_tokens_in_context:
235- type: integer
236- memory_bank_configs:
237- items:
238- oneOf:
239- - additionalProperties: false
240- properties:
241- bank_id:
242- type: string
243- type:
244- const: vector
245- type: string
246- required:
247- - bank_id
248- - type
249- type: object
250- - additionalProperties: false
251- properties:
252- bank_id:
253- type: string
254- keys:
255- items:
256- type: string
257- type: array
258- type:
259- const: keyvalue
260- type: string
261- required:
262- - bank_id
263- - type
264- - keys
265- type: object
266- - additionalProperties: false
267- properties:
268- bank_id:
269- type: string
270- type:
271- const: keyword
272- type: string
273- required:
274- - bank_id
275- - type
276- type: object
277- - additionalProperties: false
278- properties:
279- bank_id:
280- type: string
281- entities:
282- items:
283- type: string
284- type: array
285- type:
286- const: graph
287- type: string
288- required:
289- - bank_id
290- - type
291- - entities
292- type: object
293- type: array
294- output_shields:
295- items:
296- $ref: '#/components/schemas/ShieldDefinition'
297- type: array
298- query_generator_config:
299- oneOf:
300- - additionalProperties: false
301- properties:
302- sep:
303- type: string
304- type:
305- const: default
306- type: string
307- required:
308- - type
309- - sep
310- type: object
311- - additionalProperties: false
312- properties:
313- model:
314- type: string
315- template:
316- type: string
317- type:
318- const: llm
319- type: string
320- required:
321- - type
322- - model
323- - template
324- type: object
325- - additionalProperties: false
326- properties:
327- type:
328- const: custom
329- type: string
330- required:
331- - type
332- type: object
333- type:
334- const: memory
335- type: string
336- required:
337- - type
338- - memory_bank_configs
339- - query_generator_config
340- - max_tokens_in_context
341- - max_chunks
342- type: object
343- type: array
344- required:
345- - agent_id
346- - session_id
347- - messages
348- type: object
349- AgenticSystemTurnCreateRequestWrapper:
350- additionalProperties: false
351- properties:
352- request:
353- $ref: '#/components/schemas/AgenticSystemTurnCreateRequest'
354- required:
355- - request
356- type: object
357183 AgenticSystemTurnResponseEvent:
358184 additionalProperties: false
359185 properties:
@@ -480,49 +306,6 @@
480306 - event_type
481307 - turn_id
482308 type: object
483- Artifact:
484- additionalProperties: false
485- properties:
486- created_at:
487- format: date-time
488- type: string
489- id:
490- type: string
491- metadata:
492- additionalProperties:
493- oneOf:
494- - type: 'null'
495- - type: boolean
496- - type: number
497- - type: string
498- - type: array
499- - type: object
500- type: object
501- name:
502- type: string
503- size:
504- type: integer
505- type:
506- $ref: '#/components/schemas/ArtifactType'
507- required:
508- - id
509- - name
510- - type
511- - size
512- - created_at
513- - metadata
514- type: object
515- ArtifactType:
516- enum:
517- - model
518- - dataset
519- - checkpoint
520- - plot
521- - metric
522- - config
523- - code
524- - other
525- type: string
526309 Attachment:
527310 additionalProperties: false
528311 properties:
@@ -574,14 +357,6 @@
574357 - model
575358 - messages_batch
576359 type: object
577- BatchChatCompletionRequestWrapper:
578- additionalProperties: false
579- properties:
580- request:
581- $ref: '#/components/schemas/BatchChatCompletionRequest'
582- required:
583- - request
584- type: object
585360 BatchChatCompletionResponse:
586361 additionalProperties: false
587362 properties:
@@ -617,14 +392,6 @@
617392 - model
618393 - content_batch
619394 type: object
620- BatchCompletionRequestWrapper:
621- additionalProperties: false
622- properties:
623- request:
624- $ref: '#/components/schemas/BatchCompletionRequest'
625- required:
626- - request
627- type: object
628395 BatchCompletionResponse:
629396 additionalProperties: false
630397 properties:
@@ -701,13 +468,18 @@
701468 - model
702469 - messages
703470 type: object
704- ChatCompletionRequestWrapper:
471+ ChatCompletionResponse:
705472 additionalProperties: false
706473 properties:
707- request:
708- $ref: '#/components/schemas/ChatCompletionRequest'
474+ completion_message:
475+ $ref: '#/components/schemas/CompletionMessage'
476+ logprobs:
477+ items:
478+ $ref: '#/components/schemas/TokenLogProbs'
479+ type: array
709480 required:
710- - request
481+ - completion_message
482+ title: Chat completion response.
711483 type: object
712484 ChatCompletionResponseEvent:
713485 additionalProperties: false
@@ -817,13 +589,18 @@
817589 - model
818590 - content
819591 type: object
820- CompletionRequestWrapper:
592+ CompletionResponse:
821593 additionalProperties: false
822594 properties:
823- request:
824- $ref: '#/components/schemas/CompletionRequest'
595+ completion_message:
596+ $ref: '#/components/schemas/CompletionMessage'
597+ logprobs:
598+ items:
599+ $ref: '#/components/schemas/TokenLogProbs'
600+ type: array
825601 required:
826- - request
602+ - completion_message
603+ title: Completion response.
827604 type: object
828605 CompletionResponseStreamChunk:
829606 additionalProperties: false
@@ -859,51 +636,40 @@
859636 - agent_id
860637 - session_name
861638 type: object
862- CreateDatasetRequest:
639+ CreateAgenticSystemTurnRequest:
863640 additionalProperties: false
864641 properties:
865- dataset:
866- $ref: '#/components/schemas/TrainEvalDataset'
867- uuid:
642+ agent_id:
868643 type: string
869- required:
870- - uuid
871- - dataset
872- title: Request to create a dataset.
873- type: object
874- CreateDatasetRequestWrapper:
875- additionalProperties: false
876- properties:
877- request:
878- $ref: '#/components/schemas/CreateDatasetRequest'
879- required:
880- - request
881- type: object
882- CreateExperimentRequest:
883- additionalProperties: false
884- properties:
885- metadata:
886- additionalProperties:
644+ attachments:
645+ items:
646+ $ref: '#/components/schemas/Attachment'
647+ type: array
648+ messages:
649+ items:
887650 oneOf:
888- - type: 'null'
889- - type: boolean
890- - type: number
891- - type: string
892- - type: array
893- - type: object
894- type: object
895- name:
651+ - $ref: '#/components/schemas/UserMessage'
652+ - $ref: '#/components/schemas/ToolResponseMessage'
653+ type: array
654+ session_id:
896655 type: string
656+ stream:
657+ type: boolean
897658 required:
898- - name
659+ - agent_id
660+ - session_id
661+ - messages
899662 type: object
900- CreateExperimentRequestWrapper:
663+ CreateDatasetRequest:
901664 additionalProperties: false
902665 properties:
903- request:
904- $ref: '#/components/schemas/CreateExperimentRequest'
666+ dataset:
667+ $ref: '#/components/schemas/TrainEvalDataset'
668+ uuid:
669+ type: string
905670 required:
906- - request
671+ - uuid
672+ - dataset
907673 type: object
908674 CreateMemoryBankRequest:
909675 additionalProperties: false
@@ -958,32 +724,6 @@
958724 - name
959725 - config
960726 type: object
961- CreateRunRequest:
962- additionalProperties: false
963- properties:
964- experiment_id:
965- type: string
966- metadata:
967- additionalProperties:
968- oneOf:
969- - type: 'null'
970- - type: boolean
971- - type: number
972- - type: string
973- - type: array
974- - type: object
975- type: object
976- required:
977- - experiment_id
978- type: object
979- CreateRunRequestWrapper:
980- additionalProperties: false
981- properties:
982- request:
983- $ref: '#/components/schemas/CreateRunRequest'
984- required:
985- - request
986- type: object
987727 DPOAlignmentConfig:
988728 additionalProperties: false
989729 properties:
@@ -1126,12 +866,6 @@
1126866 EvaluateQuestionAnsweringRequest:
1127867 additionalProperties: false
1128868 properties:
1129- checkpoint:
1130- $ref: '#/components/schemas/Checkpoint'
1131- dataset:
1132- $ref: '#/components/schemas/TrainEvalDataset'
1133- job_uuid:
1134- type: string
1135869 metrics:
1136870 items:
1137871 enum:
@@ -1139,33 +873,12 @@
1139873 - f1
1140874 type: string
1141875 type: array
1142- sampling_params:
1143- $ref: '#/components/schemas/SamplingParams'
1144876 required:
1145- - job_uuid
1146- - dataset
1147- - checkpoint
1148- - sampling_params
1149877 - metrics
1150- title: Request to evaluate question answering.
1151- type: object
1152- EvaluateQuestionAnsweringRequestWrapper:
1153- additionalProperties: false
1154- properties:
1155- request:
1156- $ref: '#/components/schemas/EvaluateQuestionAnsweringRequest'
1157- required:
1158- - request
1159878 type: object
1160879 EvaluateSummarizationRequest:
1161880 additionalProperties: false
1162881 properties:
1163- checkpoint:
1164- $ref: '#/components/schemas/Checkpoint'
1165- dataset:
1166- $ref: '#/components/schemas/TrainEvalDataset'
1167- job_uuid:
1168- type: string
1169882 metrics:
1170883 items:
1171884 enum:
@@ -1173,33 +886,12 @@
1173886 - bleu
1174887 type: string
1175888 type: array
1176- sampling_params:
1177- $ref: '#/components/schemas/SamplingParams'
1178889 required:
1179- - job_uuid
1180- - dataset
1181- - checkpoint
1182- - sampling_params
1183890 - metrics
1184- title: Request to evaluate summarization.
1185- type: object
1186- EvaluateSummarizationRequestWrapper:
1187- additionalProperties: false
1188- properties:
1189- request:
1190- $ref: '#/components/schemas/EvaluateSummarizationRequest'
1191- required:
1192- - request
1193891 type: object
1194892 EvaluateTextGenerationRequest:
1195893 additionalProperties: false
1196894 properties:
1197- checkpoint:
1198- $ref: '#/components/schemas/Checkpoint'
1199- dataset:
1200- $ref: '#/components/schemas/TrainEvalDataset'
1201- job_uuid:
1202- type: string
1203895 metrics:
1204896 items:
1205897 enum:
@@ -1208,23 +900,8 @@
1208900 - bleu
1209901 type: string
1210902 type: array
1211- sampling_params:
1212- $ref: '#/components/schemas/SamplingParams'
1213903 required:
1214- - job_uuid
1215- - dataset
1216- - checkpoint
1217- - sampling_params
1218904 - metrics
1219- title: Request to evaluate text generation.
1220- type: object
1221- EvaluateTextGenerationRequestWrapper:
1222- additionalProperties: false
1223- properties:
1224- request:
1225- $ref: '#/components/schemas/EvaluateTextGenerationRequest'
1226- required:
1227- - request
1228905 type: object
1229906 EvaluationJob:
1230907 additionalProperties: false
@@ -1259,46 +936,6 @@
1259936 required:
1260937 - job_uuid
1261938 type: object
1262- Experiment:
1263- additionalProperties: false
1264- properties:
1265- created_at:
1266- format: date-time
1267- type: string
1268- id:
1269- type: string
1270- metadata:
1271- additionalProperties:
1272- oneOf:
1273- - type: 'null'
1274- - type: boolean
1275- - type: number
1276- - type: string
1277- - type: array
1278- - type: object
1279- type: object
1280- name:
1281- type: string
1282- status:
1283- $ref: '#/components/schemas/ExperimentStatus'
1284- updated_at:
1285- format: date-time
1286- type: string
1287- required:
1288- - id
1289- - name
1290- - status
1291- - created_at
1292- - updated_at
1293- - metadata
1294- type: object
1295- ExperimentStatus:
1296- enum:
1297- - not_started
1298- - running
1299- - completed
1300- - failed
1301- type: string
1302939 FinetuningAlgorithm:
1303940 enum:
1304941 - full
@@ -1393,107 +1030,26 @@
13931030 - bank_id
13941031 - documents
13951032 type: object
1396- ListArtifactsRequest:
1397- additionalProperties: false
1398- properties:
1399- experiment_id:
1400- type: string
1401- required:
1402- - experiment_id
1403- type: object
1404- Log:
1405- additionalProperties: false
1406- properties:
1407- additional_info:
1408- additionalProperties:
1409- oneOf:
1410- - type: 'null'
1411- - type: boolean
1412- - type: number
1413- - type: string
1414- - type: array
1415- - type: object
1416- type: object
1417- level:
1418- type: string
1419- message:
1420- type: string
1421- timestamp:
1422- format: date-time
1423- type: string
1424- required:
1425- - message
1426- - level
1427- - timestamp
1428- - additional_info
1429- type: object
1430- LogMessagesRequest:
1431- additionalProperties: false
1432- properties:
1433- logs:
1434- items:
1435- $ref: '#/components/schemas/Log'
1436- type: array
1437- run_id:
1438- type: string
1439- required:
1440- - logs
1441- type: object
1442- LogMessagesRequestWrapper:
1443- additionalProperties: false
1444- properties:
1445- request:
1446- $ref: '#/components/schemas/LogMessagesRequest'
1447- required:
1448- - request
1449- type: object
1450- LogMetricsRequest:
1451- additionalProperties: false
1452- properties:
1453- metrics:
1454- items:
1455- $ref: '#/components/schemas/Metric'
1456- type: array
1457- run_id:
1458- type: string
1459- required:
1460- - run_id
1461- - metrics
1462- type: object
1463- LogMetricsRequestWrapper:
1464- additionalProperties: false
1465- properties:
1466- request:
1467- $ref: '#/components/schemas/LogMetricsRequest'
1468- required:
1469- - request
1470- type: object
1471- LogSearchRequest:
1472- additionalProperties: false
1473- properties:
1474- filters:
1475- additionalProperties:
1476- oneOf:
1477- - type: 'null'
1478- - type: boolean
1479- - type: number
1480- - type: string
1481- - type: array
1482- - type: object
1483- type: object
1484- query:
1485- type: string
1486- required:
1487- - query
1488- type: object
1489- LogSearchRequestWrapper:
1033+ LogEventRequest:
14901034 additionalProperties: false
14911035 properties:
1492- request:
1493- $ref: '#/components/schemas/LogSearchRequest'
1036+ event:
1037+ oneOf:
1038+ - $ref: '#/components/schemas/UnstructuredLogEvent'
1039+ - $ref: '#/components/schemas/MetricEvent'
1040+ - $ref: '#/components/schemas/StructuredLogEvent'
14941041 required:
1495- - request
1042+ - event
14961043 type: object
1044+ LogSeverity:
1045+ enum:
1046+ - verbose
1047+ - debug
1048+ - info
1049+ - warn
1050+ - error
1051+ - critical
1052+ type: string
14971053 LoraFinetuningConfig:
14981054 additionalProperties: false
14991055 properties:
@@ -1635,27 +1191,45 @@
16351191 - memory_bank_ids
16361192 - inserted_context
16371193 type: object
1638- Metric:
1194+ MetricEvent:
16391195 additionalProperties: false
16401196 properties:
1641- name:
1197+ attributes:
1198+ additionalProperties:
1199+ oneOf:
1200+ - type: 'null'
1201+ - type: boolean
1202+ - type: number
1203+ - type: string
1204+ - type: array
1205+ - type: object
1206+ type: object
1207+ metric:
16421208 type: string
1643- run_id:
1209+ span_id:
16441210 type: string
16451211 timestamp:
16461212 format: date-time
16471213 type: string
1214+ trace_id:
1215+ type: string
1216+ type:
1217+ const: metric
1218+ type: string
1219+ unit:
1220+ type: string
16481221 value:
16491222 oneOf:
1650- - type: number
16511223 - type: integer
1652- - type: string
1653- - type: boolean
1224+ - type: number
16541225 required:
1655- - name
1656- - value
1226+ - trace_id
1227+ - span_id
16571228 - timestamp
1658- - run_id
1229+ - type
1230+ - metric
1231+ - value
1232+ - unit
16591233 type: object
16601234 OnViolationAction:
16611235 enum:
@@ -1782,7 +1356,7 @@
17821356 - checkpoints
17831357 title: Status of a finetuning job.
17841358 type: object
1785- PostTrainingRLHFRequest:
1359+ PreferenceOptimizeRequest:
17861360 additionalProperties: false
17871361 properties:
17881362 algorithm:
@@ -1823,70 +1397,7 @@
18231397 $ref: '#/components/schemas/TrainEvalDataset'
18241398 required:
18251399 - job_uuid
1826- - finetuned_model
1827- - dataset
1828- - validation_dataset
1829- - algorithm
1830- - algorithm_config
1831- - optimizer_config
1832- - training_config
1833- - hyperparam_search_config
1834- - logger_config
1835- title: Request to finetune a model.
1836- type: object
1837- PostTrainingRLHFRequestWrapper:
1838- additionalProperties: false
1839- properties:
1840- request:
1841- $ref: '#/components/schemas/PostTrainingRLHFRequest'
1842- required:
1843- - request
1844- type: object
1845- PostTrainingSFTRequest:
1846- additionalProperties: false
1847- properties:
1848- algorithm:
1849- $ref: '#/components/schemas/FinetuningAlgorithm'
1850- algorithm_config:
1851- oneOf:
1852- - $ref: '#/components/schemas/LoraFinetuningConfig'
1853- - $ref: '#/components/schemas/QLoraFinetuningConfig'
1854- - $ref: '#/components/schemas/DoraFinetuningConfig'
1855- dataset:
1856- $ref: '#/components/schemas/TrainEvalDataset'
1857- hyperparam_search_config:
1858- additionalProperties:
1859- oneOf:
1860- - type: 'null'
1861- - type: boolean
1862- - type: number
1863- - type: string
1864- - type: array
1865- - type: object
1866- type: object
1867- job_uuid:
1868- type: string
1869- logger_config:
1870- additionalProperties:
1871- oneOf:
1872- - type: 'null'
1873- - type: boolean
1874- - type: number
1875- - type: string
1876- - type: array
1877- - type: object
1878- type: object
1879- model:
1880- type: string
1881- optimizer_config:
1882- $ref: '#/components/schemas/OptimizerConfig'
1883- training_config:
1884- $ref: '#/components/schemas/TrainingConfig'
1885- validation_dataset:
1886- $ref: '#/components/schemas/TrainEvalDataset'
1887- required:
1888- - job_uuid
1889- - model
1400+ - finetuned_model
18901401 - dataset
18911402 - validation_dataset
18921403 - algorithm
@@ -1895,15 +1406,6 @@
18951406 - training_config
18961407 - hyperparam_search_config
18971408 - logger_config
1898- title: Request to finetune a model.
1899- type: object
1900- PostTrainingSFTRequestWrapper:
1901- additionalProperties: false
1902- properties:
1903- request:
1904- $ref: '#/components/schemas/PostTrainingSFTRequest'
1905- required:
1906- - request
19071409 type: object
19081410 QLoraFinetuningConfig:
19091411 additionalProperties: false
@@ -2035,7 +1537,7 @@
20351537 - PUT
20361538 - DELETE
20371539 type: string
2038- RewardScoringRequest:
1540+ RewardScoreRequest:
20391541 additionalProperties: false
20401542 properties:
20411543 dialog_generations:
@@ -2047,16 +1549,6 @@
20471549 required:
20481550 - dialog_generations
20491551 - model
2050- title: Request to score a reward function. A list of prompts and a list of responses
2051- per prompt.
2052- type: object
2053- RewardScoringRequestWrapper:
2054- additionalProperties: false
2055- properties:
2056- request:
2057- $ref: '#/components/schemas/RewardScoringRequest'
2058- required:
2059- - request
20601552 type: object
20611553 RewardScoringResponse:
20621554 additionalProperties: false
@@ -2070,39 +1562,17 @@
20701562 title: Response from the reward scoring. Batch of (prompt, response, score)
20711563 tuples that pass the threshold.
20721564 type: object
2073- Run:
1565+ RunShieldResponse:
20741566 additionalProperties: false
20751567 properties:
2076- ended_at:
2077- format: date-time
2078- type: string
2079- experiment_id:
2080- type: string
2081- id:
2082- type: string
2083- metadata:
2084- additionalProperties:
2085- oneOf:
2086- - type: 'null'
2087- - type: boolean
2088- - type: number
2089- - type: string
2090- - type: array
2091- - type: object
2092- type: object
2093- started_at:
2094- format: date-time
2095- type: string
2096- status:
2097- type: string
1568+ responses:
1569+ items:
1570+ $ref: '#/components/schemas/ShieldResponse'
1571+ type: array
20981572 required:
2099- - id
2100- - experiment_id
2101- - status
2102- - started_at
2103- - metadata
1573+ - responses
21041574 type: object
2105- RunShieldRequest:
1575+ RunShieldsRequest:
21061576 additionalProperties: false
21071577 properties:
21081578 messages:
@@ -2121,24 +1591,6 @@
21211591 - messages
21221592 - shields
21231593 type: object
2124- RunShieldRequestWrapper:
2125- additionalProperties: false
2126- properties:
2127- request:
2128- $ref: '#/components/schemas/RunShieldRequest'
2129- required:
2130- - request
2131- type: object
2132- RunShieldResponse:
2133- additionalProperties: false
2134- properties:
2135- responses:
2136- items:
2137- $ref: '#/components/schemas/ShieldResponse'
2138- type: array
2139- required:
2140- - responses
2141- type: object
21421594 SamplingParams:
21431595 additionalProperties: false
21441596 properties:
@@ -2307,13 +1759,132 @@
23071759 - shield_type
23081760 - is_violation
23091761 type: object
1762+ SpanEndPayload:
1763+ additionalProperties: false
1764+ properties:
1765+ status:
1766+ $ref: '#/components/schemas/SpanStatus'
1767+ type:
1768+ const: span_end
1769+ type: string
1770+ required:
1771+ - type
1772+ - status
1773+ type: object
1774+ SpanStartPayload:
1775+ additionalProperties: false
1776+ properties:
1777+ name:
1778+ type: string
1779+ parent_span_id:
1780+ type: string
1781+ type:
1782+ const: span_start
1783+ type: string
1784+ required:
1785+ - type
1786+ - name
1787+ type: object
1788+ SpanStatus:
1789+ enum:
1790+ - ok
1791+ - error
1792+ type: string
23101793 StopReason:
23111794 enum:
23121795 - end_of_turn
23131796 - end_of_message
23141797 - out_of_tokens
23151798 type: string
2316- SyntheticDataGenerationRequest:
1799+ StructuredLogEvent:
1800+ additionalProperties: false
1801+ properties:
1802+ attributes:
1803+ additionalProperties:
1804+ oneOf:
1805+ - type: 'null'
1806+ - type: boolean
1807+ - type: number
1808+ - type: string
1809+ - type: array
1810+ - type: object
1811+ type: object
1812+ payload:
1813+ oneOf:
1814+ - $ref: '#/components/schemas/SpanStartPayload'
1815+ - $ref: '#/components/schemas/SpanEndPayload'
1816+ span_id:
1817+ type: string
1818+ timestamp:
1819+ format: date-time
1820+ type: string
1821+ trace_id:
1822+ type: string
1823+ type:
1824+ const: structured_log
1825+ type: string
1826+ required:
1827+ - trace_id
1828+ - span_id
1829+ - timestamp
1830+ - type
1831+ - payload
1832+ type: object
1833+ SupervisedFineTuneRequest:
1834+ additionalProperties: false
1835+ properties:
1836+ algorithm:
1837+ $ref: '#/components/schemas/FinetuningAlgorithm'
1838+ algorithm_config:
1839+ oneOf:
1840+ - $ref: '#/components/schemas/LoraFinetuningConfig'
1841+ - $ref: '#/components/schemas/QLoraFinetuningConfig'
1842+ - $ref: '#/components/schemas/DoraFinetuningConfig'
1843+ dataset:
1844+ $ref: '#/components/schemas/TrainEvalDataset'
1845+ hyperparam_search_config:
1846+ additionalProperties:
1847+ oneOf:
1848+ - type: 'null'
1849+ - type: boolean
1850+ - type: number
1851+ - type: string
1852+ - type: array
1853+ - type: object
1854+ type: object
1855+ job_uuid:
1856+ type: string
1857+ logger_config:
1858+ additionalProperties:
1859+ oneOf:
1860+ - type: 'null'
1861+ - type: boolean
1862+ - type: number
1863+ - type: string
1864+ - type: array
1865+ - type: object
1866+ type: object
1867+ model:
1868+ type: string
1869+ optimizer_config:
1870+ $ref: '#/components/schemas/OptimizerConfig'
1871+ training_config:
1872+ $ref: '#/components/schemas/TrainingConfig'
1873+ validation_dataset:
1874+ $ref: '#/components/schemas/TrainEvalDataset'
1875+ required:
1876+ - job_uuid
1877+ - model
1878+ - dataset
1879+ - validation_dataset
1880+ - algorithm
1881+ - algorithm_config
1882+ - optimizer_config
1883+ - training_config
1884+ - hyperparam_search_config
1885+ - logger_config
1886+ type: object
1887+ SyntheticDataGenerateRequest:
23171888 additionalProperties: false
23181889 properties:
23191890 dialogs:
@@ -2339,16 +1910,6 @@
23391910 required:
23401911 - dialogs
23411912 - filtering_function
2342- title: Request to generate synthetic data. A small batch of prompts and a filtering
2343- function
2344- type: object
2345- SyntheticDataGenerationRequestWrapper:
2346- additionalProperties: false
2347- properties:
2348- request:
2349- $ref: '#/components/schemas/SyntheticDataGenerationRequest'
2350- required:
2351- - request
23521913 type: object
23531914 SyntheticDataGenerationResponse:
23541915 additionalProperties: false
@@ -2580,6 +2141,24 @@
25802141 - tool_name
25812142 - content
25822143 type: object
2144+ Trace:
2145+ additionalProperties: false
2146+ properties:
2147+ end_time:
2148+ format: date-time
2149+ type: string
2150+ root_span_id:
2151+ type: string
2152+ start_time:
2153+ format: date-time
2154+ type: string
2155+ trace_id:
2156+ type: string
2157+ required:
2158+ - trace_id
2159+ - root_span_id
2160+ - start_time
2161+ type: object
25832162 TrainEvalDataset:
25842163 additionalProperties: false
25852164 properties:
@@ -2685,54 +2264,10 @@
26852264 format: uri
26862265 pattern: ^(https?://|file://|data:)
26872266 type: string
2688- UpdateDocumentsRequest:
2689- additionalProperties: false
2690- properties:
2691- bank_id:
2692- type: string
2693- documents:
2694- items:
2695- $ref: '#/components/schemas/MemoryBankDocument'
2696- type: array
2697- required:
2698- - bank_id
2699- - documents
2700- type: object
2701- UpdateExperimentRequest:
2702- additionalProperties: false
2703- properties:
2704- experiment_id:
2705- type: string
2706- metadata:
2707- additionalProperties:
2708- oneOf:
2709- - type: 'null'
2710- - type: boolean
2711- - type: number
2712- - type: string
2713- - type: array
2714- - type: object
2715- type: object
2716- status:
2717- $ref: '#/components/schemas/ExperimentStatus'
2718- required:
2719- - experiment_id
2720- type: object
2721- UpdateExperimentRequestWrapper:
2722- additionalProperties: false
2723- properties:
2724- request:
2725- $ref: '#/components/schemas/UpdateExperimentRequest'
2726- required:
2727- - request
2728- type: object
2729- UpdateRunRequest:
2267+ UnstructuredLogEvent:
27302268 additionalProperties: false
27312269 properties:
2732- ended_at:
2733- format: date-time
2734- type: string
2735- metadata:
2270+ attributes:
27362271 additionalProperties:
27372272 oneOf:
27382273 - type: 'null'
@@ -2742,56 +2277,40 @@
27422277 - type: array
27432278 - type: object
27442279 type: object
2745- run_id:
2746- type: string
2747- status:
2280+ message:
27482281 type: string
2749- required:
2750- - run_id
2751- type: object
2752- UpdateRunRequestWrapper:
2753- additionalProperties: false
2754- properties:
2755- request:
2756- $ref: '#/components/schemas/UpdateRunRequest'
2757- required:
2758- - request
2759- type: object
2760- UploadArtifactRequest:
2761- additionalProperties: false
2762- properties:
2763- artifact_type:
2282+ severity:
2283+ $ref: '#/components/schemas/LogSeverity'
2284+ span_id:
27642285 type: string
2765- content:
2766- contentEncoding: base64
2286+ timestamp:
2287+ format: date-time
27672288 type: string
2768- experiment_id:
2289+ trace_id:
27692290 type: string
2770- metadata:
2771- additionalProperties:
2772- oneOf:
2773- - type: 'null'
2774- - type: boolean
2775- - type: number
2776- - type: string
2777- - type: array
2778- - type: object
2779- type: object
2780- name:
2291+ type:
2292+ const: unstructured_log
27812293 type: string
27822294 required:
2783- - experiment_id
2784- - name
2785- - artifact_type
2786- - content
2295+ - trace_id
2296+ - span_id
2297+ - timestamp
2298+ - type
2299+ - message
2300+ - severity
27872301 type: object
2788- UploadArtifactRequestWrapper:
2302+ UpdateDocumentsRequest:
27892303 additionalProperties: false
27902304 properties:
2791- request:
2792- $ref: '#/components/schemas/UploadArtifactRequest'
2305+ bank_id:
2306+ type: string
2307+ documents:
2308+ items:
2309+ $ref: '#/components/schemas/MemoryBankDocument'
2310+ type: array
27932311 required:
2794- - request
2312+ - bank_id
2313+ - documents
27952314 type: object
27962315 UserMessage:
27972316 additionalProperties: false
@@ -2838,7 +2357,7 @@
28382357 description: "This is the specification of the llama stack that provides\n \
28392358 \ a set of endpoints and their corresponding interfaces that are tailored\
28402359 \ to\n best leverage Llama Models. The specification is still in\
2841- \ draft and subject to change.\n Generated at 2024-09-10 16:42:15.870336"
2360+ \ draft and subject to change.\n Generated at 2024-09-11 16:05:23.016090"
28422361 title: '[DRAFT] Llama Stack Specification'
28432362 version: 0.0.1
28442363 jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
@@ -2970,7 +2489,7 @@
29702489 content:
29712490 application/json:
29722491 schema:
2973- $ref: '#/components/schemas/AgenticSystemTurnCreateRequestWrapper'
2492+ $ref: '#/components/schemas/CreateAgenticSystemTurnRequest'
29742493 required: true
29752494 responses:
29762495 '200':
@@ -2990,24 +2509,7 @@
29902509 schema:
29912510 type: string
29922511 - in: query
2993- name: turn_id
2994- required: true
2995- schema:
2996- type: string
2997- responses:
2998- '200':
2999- content:
3000- application/json:
3001- schema:
3002- $ref: '#/components/schemas/Turn'
3003- description: OK
3004- tags:
3005- - AgenticSystem
3006- /artifacts/get:
3007- get:
3008- parameters:
3009- - in: query
3010- name: artifact_id
2512+ name: turn_id
30112513 required: true
30122514 schema:
30132515 type: string
@@ -3016,10 +2518,10 @@
30162518 content:
30172519 application/json:
30182520 schema:
3019- $ref: '#/components/schemas/Artifact'
2521+ $ref: '#/components/schemas/Turn'
30202522 description: OK
30212523 tags:
3022- - Telemetry
2524+ - AgenticSystem
30232525 /batch_inference/chat_completion:
30242526 post:
30252527 parameters: []
@@ -3027,7 +2529,7 @@
30272529 content:
30282530 application/json:
30292531 schema:
3030- $ref: '#/components/schemas/BatchChatCompletionRequestWrapper'
2532+ $ref: '#/components/schemas/BatchChatCompletionRequest'
30312533 required: true
30322534 responses:
30332535 '200':
@@ -3045,7 +2547,7 @@
30452547 content:
30462548 application/json:
30472549 schema:
3048- $ref: '#/components/schemas/BatchCompletionRequestWrapper'
2550+ $ref: '#/components/schemas/BatchCompletionRequest'
30492551 required: true
30502552 responses:
30512553 '200':
@@ -3063,7 +2565,7 @@
30632565 content:
30642566 application/json:
30652567 schema:
3066- $ref: '#/components/schemas/CreateDatasetRequestWrapper'
2568+ $ref: '#/components/schemas/CreateDatasetRequest'
30672569 required: true
30682570 responses:
30692571 '200':
@@ -3185,7 +2687,7 @@
31852687 content:
31862688 application/json:
31872689 schema:
3188- $ref: '#/components/schemas/EvaluateQuestionAnsweringRequestWrapper'
2690+ $ref: '#/components/schemas/EvaluateQuestionAnsweringRequest'
31892691 required: true
31902692 responses:
31912693 '200':
@@ -3203,7 +2705,7 @@
32032705 content:
32042706 application/json:
32052707 schema:
3206- $ref: '#/components/schemas/EvaluateSummarizationRequestWrapper'
2708+ $ref: '#/components/schemas/EvaluateSummarizationRequest'
32072709 required: true
32082710 responses:
32092711 '200':
@@ -3221,7 +2723,7 @@
32212723 content:
32222724 application/json:
32232725 schema:
3224- $ref: '#/components/schemas/EvaluateTextGenerationRequestWrapper'
2726+ $ref: '#/components/schemas/EvaluateTextGenerationRequest'
32252727 required: true
32262728 responses:
32272729 '200':
@@ -3232,125 +2734,6 @@
32322734 description: OK
32332735 tags:
32342736 - Evaluations
3235- /experiments/artifacts/get:
3236- post:
3237- parameters: []
3238- requestBody:
3239- content:
3240- application/json:
3241- schema:
3242- $ref: '#/components/schemas/ListArtifactsRequest'
3243- required: true
3244- responses:
3245- '200':
3246- content:
3247- application/jsonl:
3248- schema:
3249- $ref: '#/components/schemas/Artifact'
3250- description: OK
3251- tags:
3252- - Telemetry
3253- /experiments/artifacts/upload:
3254- post:
3255- parameters: []
3256- requestBody:
3257- content:
3258- application/json:
3259- schema:
3260- $ref: '#/components/schemas/UploadArtifactRequestWrapper'
3261- required: true
3262- responses:
3263- '200':
3264- content:
3265- application/json:
3266- schema:
3267- $ref: '#/components/schemas/Artifact'
3268- description: OK
3269- tags:
3270- - Telemetry
3271- /experiments/create:
3272- post:
3273- parameters: []
3274- requestBody:
3275- content:
3276- application/json:
3277- schema:
3278- $ref: '#/components/schemas/CreateExperimentRequestWrapper'
3279- required: true
3280- responses:
3281- '200':
3282- content:
3283- application/json:
3284- schema:
3285- $ref: '#/components/schemas/Experiment'
3286- description: OK
3287- tags:
3288- - Telemetry
3289- /experiments/create_run:
3290- post:
3291- parameters: []
3292- requestBody:
3293- content:
3294- application/json:
3295- schema:
3296- $ref: '#/components/schemas/CreateRunRequestWrapper'
3297- required: true
3298- responses:
3299- '200':
3300- content:
3301- application/json:
3302- schema:
3303- $ref: '#/components/schemas/Run'
3304- description: OK
3305- tags:
3306- - Telemetry
3307- /experiments/get:
3308- get:
3309- parameters:
3310- - in: query
3311- name: experiment_id
3312- required: true
3313- schema:
3314- type: string
3315- responses:
3316- '200':
3317- content:
3318- application/json:
3319- schema:
3320- $ref: '#/components/schemas/Experiment'
3321- description: OK
3322- tags:
3323- - Telemetry
3324- /experiments/list:
3325- get:
3326- parameters: []
3327- responses:
3328- '200':
3329- content:
3330- application/jsonl:
3331- schema:
3332- $ref: '#/components/schemas/Experiment'
3333- description: OK
3334- tags:
3335- - Telemetry
3336- /experiments/update:
3337- post:
3338- parameters: []
3339- requestBody:
3340- content:
3341- application/json:
3342- schema:
3343- $ref: '#/components/schemas/UpdateExperimentRequestWrapper'
3344- required: true
3345- responses:
3346- '200':
3347- content:
3348- application/json:
3349- schema:
3350- $ref: '#/components/schemas/Experiment'
3351- description: OK
3352- tags:
3353- - Telemetry
33542737 /inference/chat_completion:
33552738 post:
33562739 parameters: []
@@ -3358,15 +2741,17 @@
33582741 content:
33592742 application/json:
33602743 schema:
3361- $ref: '#/components/schemas/ChatCompletionRequestWrapper'
2744+ $ref: '#/components/schemas/ChatCompletionRequest'
33622745 required: true
33632746 responses:
33642747 '200':
33652748 content:
33662749 text/event-stream:
33672750 schema:
3368- $ref: '#/components/schemas/ChatCompletionResponseStreamChunk'
3369- description: SSE-stream of these events.
2751+ oneOf:
2752+ - $ref: '#/components/schemas/ChatCompletionResponse'
2753+ - $ref: '#/components/schemas/ChatCompletionResponseStreamChunk'
2754+ description: Chat completion response. **OR** SSE-stream of these events.
33702755 tags:
33712756 - Inference
33722757 /inference/completion:
@@ -3376,15 +2761,17 @@
33762761 content:
33772762 application/json:
33782763 schema:
3379- $ref: '#/components/schemas/CompletionRequestWrapper'
2764+ $ref: '#/components/schemas/CompletionRequest'
33802765 required: true
33812766 responses:
33822767 '200':
33832768 content:
33842769 application/json:
33852770 schema:
3386- $ref: '#/components/schemas/CompletionResponseStreamChunk'
3387- description: streamed completion response.
2771+ oneOf:
2772+ - $ref: '#/components/schemas/CompletionResponse'
2773+ - $ref: '#/components/schemas/CompletionResponseStreamChunk'
2774+ description: Completion response. **OR** streamed completion response.
33882775 tags:
33892776 - Inference
33902777 /inference/embeddings:
@@ -3405,38 +2792,6 @@
34052792 description: OK
34062793 tags:
34072794 - Inference
3408- /logging/get_logs:
3409- post:
3410- parameters: []
3411- requestBody:
3412- content:
3413- application/json:
3414- schema:
3415- $ref: '#/components/schemas/LogSearchRequestWrapper'
3416- required: true
3417- responses:
3418- '200':
3419- content:
3420- application/jsonl:
3421- schema:
3422- $ref: '#/components/schemas/Log'
3423- description: OK
3424- tags:
3425- - Telemetry
3426- /logging/log_messages:
3427- post:
3428- parameters: []
3429- requestBody:
3430- content:
3431- application/json:
3432- schema:
3433- $ref: '#/components/schemas/LogMessagesRequestWrapper'
3434- required: true
3435- responses:
3436- '200':
3437- description: OK
3438- tags:
3439- - Telemetry
34402795 /memory_bank/documents/delete:
34412796 post:
34422797 parameters: []
@@ -3671,7 +3026,7 @@
36713026 content:
36723027 application/json:
36733028 schema:
3674- $ref: '#/components/schemas/PostTrainingRLHFRequestWrapper'
3029+ $ref: '#/components/schemas/PreferenceOptimizeRequest'
36753030 required: true
36763031 responses:
36773032 '200':
@@ -3689,7 +3044,7 @@
36893044 content:
36903045 application/json:
36913046 schema:
3692- $ref: '#/components/schemas/PostTrainingSFTRequestWrapper'
3047+ $ref: '#/components/schemas/SupervisedFineTuneRequest'
36933048 required: true
36943049 responses:
36953050 '200':
@@ -3707,7 +3062,7 @@
37073062 content:
37083063 application/json:
37093064 schema:
3710- $ref: '#/components/schemas/RewardScoringRequestWrapper'
3065+ $ref: '#/components/schemas/RewardScoreRequest'
37113066 required: true
37123067 responses:
37133068 '200':
@@ -3718,110 +3073,89 @@
37183073 description: OK
37193074 tags:
37203075 - RewardScoring
3721- /runs/log_metrics:
3076+ /safety/run_shields:
37223077 post:
37233078 parameters: []
37243079 requestBody:
37253080 content:
37263081 application/json:
37273082 schema:
3728- $ref: '#/components/schemas/LogMetricsRequestWrapper'
3729- required: true
3730- responses:
3731- '200':
3732- description: OK
3733- tags:
3734- - Telemetry
3735- /runs/metrics:
3736- get:
3737- parameters:
3738- - in: query
3739- name: run_id
3083+ $ref: '#/components/schemas/RunShieldsRequest'
37403084 required: true
3741- schema:
3742- type: string
37433085 responses:
37443086 '200':
37453087 content:
3746- application/jsonl:
3088+ application/json:
37473089 schema:
3748- $ref: '#/components/schemas/Metric'
3090+ $ref: '#/components/schemas/RunShieldResponse'
37493091 description: OK
37503092 tags:
3751- - Telemetry
3752- /runs/update:
3093+ - Safety
3094+ /synthetic_data_generation/generate:
37533095 post:
37543096 parameters: []
37553097 requestBody:
37563098 content:
37573099 application/json:
37583100 schema:
3759- $ref: '#/components/schemas/UpdateRunRequestWrapper'
3101+ $ref: '#/components/schemas/SyntheticDataGenerateRequest'
37603102 required: true
37613103 responses:
37623104 '200':
37633105 content:
37643106 application/json:
37653107 schema:
3766- $ref: '#/components/schemas/Run'
3108+ $ref: '#/components/schemas/SyntheticDataGenerationResponse'
37673109 description: OK
37683110 tags:
3769- - Telemetry
3770- /safety/run_shields:
3771- post:
3772- parameters: []
3773- requestBody:
3774- content:
3775- application/json:
3776- schema:
3777- $ref: '#/components/schemas/RunShieldRequestWrapper'
3111+ - SyntheticDataGeneration
3112+ /telemetry/get_trace:
3113+ get:
3114+ parameters:
3115+ - in: query
3116+ name: trace_id
37783117 required: true
3118+ schema:
3119+ type: string
37793120 responses:
37803121 '200':
37813122 content:
37823123 application/json:
37833124 schema:
3784- $ref: '#/components/schemas/RunShieldResponse'
3125+ $ref: '#/components/schemas/Trace'
37853126 description: OK
37863127 tags:
3787- - Safety
3788- /synthetic_data_generation/generate:
3128+ - Telemetry
3129+ /telemetry/log_event:
37893130 post:
37903131 parameters: []
37913132 requestBody:
37923133 content:
37933134 application/json:
37943135 schema:
3795- $ref: '#/components/schemas/SyntheticDataGenerationRequestWrapper'
3136+ $ref: '#/components/schemas/LogEventRequest'
37963137 required: true
37973138 responses:
37983139 '200':
3799- content:
3800- application/json:
3801- schema:
3802- $ref: '#/components/schemas/SyntheticDataGenerationResponse'
38033140 description: OK
38043141 tags:
3805- - SyntheticDataGeneration
3142+ - Telemetry
38063143 security:
38073144 - Default: []
38083145 servers:
38093146 - url: http://any-hosted-llama-stack.com
38103147 tags:
3811-- name: BatchInference
3812-- name: Safety
3813-- name: Telemetry
3814-- name: RewardScoring
3815-- name: Memory
38163148 - name: SyntheticDataGeneration
3817-- name: Inference
3149+- name: Datasets
38183150 - name: Evaluations
3151+- name: Safety
3152+- name: Inference
3153+- name: Telemetry
38193154 - name: PostTraining
3820-- name: Datasets
3155+- name: Memory
3156+- name: RewardScoring
3157+- name: BatchInference
38213158 - name: AgenticSystem
3822-- description: <SchemaDefinition schemaRef="#/components/schemas/BatchChatCompletionRequest"
3823- />
3824- name: BatchChatCompletionRequest
38253159 - description: <SchemaDefinition schemaRef="#/components/schemas/BuiltinTool" />
38263160 name: BuiltinTool
38273161 - description: <SchemaDefinition schemaRef="#/components/schemas/CompletionMessage"
@@ -3861,18 +3195,15 @@
38613195 name: ToolResponseMessage
38623196 - description: <SchemaDefinition schemaRef="#/components/schemas/UserMessage" />
38633197 name: UserMessage
3864-- description: <SchemaDefinition schemaRef="#/components/schemas/BatchChatCompletionRequestWrapper"
3198+- description: <SchemaDefinition schemaRef="#/components/schemas/BatchChatCompletionRequest"
38653199 />
3866- name: BatchChatCompletionRequestWrapper
3200+ name: BatchChatCompletionRequest
38673201 - description: <SchemaDefinition schemaRef="#/components/schemas/BatchChatCompletionResponse"
38683202 />
38693203 name: BatchChatCompletionResponse
38703204 - description: <SchemaDefinition schemaRef="#/components/schemas/BatchCompletionRequest"
38713205 />
38723206 name: BatchCompletionRequest
3873-- description: <SchemaDefinition schemaRef="#/components/schemas/BatchCompletionRequestWrapper"
3874- />
3875- name: BatchCompletionRequestWrapper
38763207 - description: <SchemaDefinition schemaRef="#/components/schemas/BatchCompletionResponse"
38773208 />
38783209 name: BatchCompletionResponse
@@ -3885,9 +3216,11 @@
38853216 - description: <SchemaDefinition schemaRef="#/components/schemas/ChatCompletionRequest"
38863217 />
38873218 name: ChatCompletionRequest
3888-- description: <SchemaDefinition schemaRef="#/components/schemas/ChatCompletionRequestWrapper"
3889- />
3890- name: ChatCompletionRequestWrapper
3219+- description: 'Chat completion response.
3220+
3221+
3222+ <SchemaDefinition schemaRef="#/components/schemas/ChatCompletionResponse" />'
3223+ name: ChatCompletionResponse
38913224 - description: 'Chat completion response event.
38923225
38933226
@@ -3913,9 +3246,11 @@
39133246 - description: <SchemaDefinition schemaRef="#/components/schemas/CompletionRequest"
39143247 />
39153248 name: CompletionRequest
3916-- description: <SchemaDefinition schemaRef="#/components/schemas/CompletionRequestWrapper"
3917- />
3918- name: CompletionRequestWrapper
3249+- description: 'Completion response.
3250+
3251+
3252+ <SchemaDefinition schemaRef="#/components/schemas/CompletionResponse" />'
3253+ name: CompletionResponse
39193254 - description: 'streamed completion response.
39203255
39213256
@@ -3966,14 +3301,11 @@
39663301 - description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemSessionCreateResponse"
39673302 />
39683303 name: AgenticSystemSessionCreateResponse
3969-- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnCreateRequest"
3970- />
3971- name: AgenticSystemTurnCreateRequest
39723304 - description: <SchemaDefinition schemaRef="#/components/schemas/Attachment" />
39733305 name: Attachment
3974-- description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemTurnCreateRequestWrapper"
3306+- description: <SchemaDefinition schemaRef="#/components/schemas/CreateAgenticSystemTurnRequest"
39753307 />
3976- name: AgenticSystemTurnCreateRequestWrapper
3308+ name: CreateAgenticSystemTurnRequest
39773309 - description: 'Streamed agent execution response.
39783310
39793311
@@ -4017,11 +3349,6 @@
40173349
40183350 <SchemaDefinition schemaRef="#/components/schemas/Turn" />'
40193351 name: Turn
4020-- description: 'Request to create a dataset.
4021-
4022-
4023- <SchemaDefinition schemaRef="#/components/schemas/CreateDatasetRequest" />'
4024- name: CreateDatasetRequest
40253352 - description: 'Dataset to be used for training or evaluating language models.
40263353
40273354
@@ -4030,33 +3357,14 @@
40303357 - description: <SchemaDefinition schemaRef="#/components/schemas/TrainEvalDatasetColumnType"
40313358 />
40323359 name: TrainEvalDatasetColumnType
4033-- description: <SchemaDefinition schemaRef="#/components/schemas/CreateDatasetRequestWrapper"
4034- />
4035- name: CreateDatasetRequestWrapper
4036-- description: <SchemaDefinition schemaRef="#/components/schemas/CreateExperimentRequest"
4037- />
4038- name: CreateExperimentRequest
4039-- description: <SchemaDefinition schemaRef="#/components/schemas/CreateExperimentRequestWrapper"
4040- />
4041- name: CreateExperimentRequestWrapper
4042-- description: <SchemaDefinition schemaRef="#/components/schemas/Experiment" />
4043- name: Experiment
4044-- description: <SchemaDefinition schemaRef="#/components/schemas/ExperimentStatus"
3360+- description: <SchemaDefinition schemaRef="#/components/schemas/CreateDatasetRequest"
40453361 />
4046- name: ExperimentStatus
3362+ name: CreateDatasetRequest
40473363 - description: <SchemaDefinition schemaRef="#/components/schemas/CreateMemoryBankRequest"
40483364 />
40493365 name: CreateMemoryBankRequest
40503366 - description: <SchemaDefinition schemaRef="#/components/schemas/MemoryBank" />
40513367 name: MemoryBank
4052-- description: <SchemaDefinition schemaRef="#/components/schemas/CreateRunRequest"
4053- />
4054- name: CreateRunRequest
4055-- description: <SchemaDefinition schemaRef="#/components/schemas/CreateRunRequestWrapper"
4056- />
4057- name: CreateRunRequestWrapper
4058-- description: <SchemaDefinition schemaRef="#/components/schemas/Run" />
4059- name: Run
40603368 - description: <SchemaDefinition schemaRef="#/components/schemas/DeleteAgenticSystemRequest"
40613369 />
40623370 name: DeleteAgenticSystemRequest
@@ -4078,40 +3386,17 @@
40783386 - description: <SchemaDefinition schemaRef="#/components/schemas/EmbeddingsResponse"
40793387 />
40803388 name: EmbeddingsResponse
4081-- description: 'Checkpoint created during training runs
4082-
4083-
4084- <SchemaDefinition schemaRef="#/components/schemas/Checkpoint" />'
4085- name: Checkpoint
4086-- description: 'Request to evaluate question answering.
4087-
4088-
4089- <SchemaDefinition schemaRef="#/components/schemas/EvaluateQuestionAnsweringRequest"
4090- />'
4091- name: EvaluateQuestionAnsweringRequest
4092-- description: <SchemaDefinition schemaRef="#/components/schemas/EvaluateQuestionAnsweringRequestWrapper"
3389+- description: <SchemaDefinition schemaRef="#/components/schemas/EvaluateQuestionAnsweringRequest"
40933390 />
4094- name: EvaluateQuestionAnsweringRequestWrapper
3391+ name: EvaluateQuestionAnsweringRequest
40953392 - description: <SchemaDefinition schemaRef="#/components/schemas/EvaluationJob" />
40963393 name: EvaluationJob
4097-- description: 'Request to evaluate summarization.
4098-
4099-
4100- <SchemaDefinition schemaRef="#/components/schemas/EvaluateSummarizationRequest"
4101- />'
3394+- description: <SchemaDefinition schemaRef="#/components/schemas/EvaluateSummarizationRequest"
3395+ />
41023396 name: EvaluateSummarizationRequest
4103-- description: <SchemaDefinition schemaRef="#/components/schemas/EvaluateSummarizationRequestWrapper"
3397+- description: <SchemaDefinition schemaRef="#/components/schemas/EvaluateTextGenerationRequest"
41043398 />
4105- name: EvaluateSummarizationRequestWrapper
4106-- description: 'Request to evaluate text generation.
4107-
4108-
4109- <SchemaDefinition schemaRef="#/components/schemas/EvaluateTextGenerationRequest"
4110- />'
41113399 name: EvaluateTextGenerationRequest
4112-- description: <SchemaDefinition schemaRef="#/components/schemas/EvaluateTextGenerationRequestWrapper"
4113- />
4114- name: EvaluateTextGenerationRequestWrapper
41153400 - description: <SchemaDefinition schemaRef="#/components/schemas/GetAgenticSystemSessionRequest"
41163401 />
41173402 name: GetAgenticSystemSessionRequest
@@ -4123,10 +3408,6 @@
41233408 - description: <SchemaDefinition schemaRef="#/components/schemas/AgenticSystemStepResponse"
41243409 />
41253410 name: AgenticSystemStepResponse
4126-- description: <SchemaDefinition schemaRef="#/components/schemas/Artifact" />
4127- name: Artifact
4128-- description: <SchemaDefinition schemaRef="#/components/schemas/ArtifactType" />
4129- name: ArtifactType
41303411 - description: <SchemaDefinition schemaRef="#/components/schemas/GetDocumentsRequest"
41313412 />
41323413 name: GetDocumentsRequest
@@ -4145,16 +3426,13 @@
41453426 - description: <SchemaDefinition schemaRef="#/components/schemas/EvaluationJobStatusResponse"
41463427 />
41473428 name: EvaluationJobStatusResponse
4148-- description: <SchemaDefinition schemaRef="#/components/schemas/LogSearchRequest"
4149- />
4150- name: LogSearchRequest
4151-- description: <SchemaDefinition schemaRef="#/components/schemas/LogSearchRequestWrapper"
4152- />
4153- name: LogSearchRequestWrapper
4154-- description: <SchemaDefinition schemaRef="#/components/schemas/Log" />
4155- name: Log
4156-- description: <SchemaDefinition schemaRef="#/components/schemas/Metric" />
4157- name: Metric
3429+- description: <SchemaDefinition schemaRef="#/components/schemas/Trace" />
3430+ name: Trace
3431+- description: 'Checkpoint created during training runs
3432+
3433+
3434+ <SchemaDefinition schemaRef="#/components/schemas/Checkpoint" />'
3435+ name: Checkpoint
41583436 - description: 'Artifacts of a finetuning job.
41593437
41603438
@@ -4181,39 +3459,39 @@
41813459 - description: <SchemaDefinition schemaRef="#/components/schemas/InsertDocumentsRequest"
41823460 />
41833461 name: InsertDocumentsRequest
4184-- description: <SchemaDefinition schemaRef="#/components/schemas/ListArtifactsRequest"
4185- />
4186- name: ListArtifactsRequest
4187-- description: <SchemaDefinition schemaRef="#/components/schemas/LogMessagesRequest"
4188- />
4189- name: LogMessagesRequest
4190-- description: <SchemaDefinition schemaRef="#/components/schemas/LogMessagesRequestWrapper"
4191- />
4192- name: LogMessagesRequestWrapper
4193-- description: <SchemaDefinition schemaRef="#/components/schemas/LogMetricsRequest"
4194- />
4195- name: LogMetricsRequest
4196-- description: <SchemaDefinition schemaRef="#/components/schemas/LogMetricsRequestWrapper"
4197- />
4198- name: LogMetricsRequestWrapper
3462+- description: <SchemaDefinition schemaRef="#/components/schemas/LogSeverity" />
3463+ name: LogSeverity
3464+- description: <SchemaDefinition schemaRef="#/components/schemas/MetricEvent" />
3465+ name: MetricEvent
3466+- description: <SchemaDefinition schemaRef="#/components/schemas/SpanEndPayload" />
3467+ name: SpanEndPayload
3468+- description: <SchemaDefinition schemaRef="#/components/schemas/SpanStartPayload"
3469+ />
3470+ name: SpanStartPayload
3471+- description: <SchemaDefinition schemaRef="#/components/schemas/SpanStatus" />
3472+ name: SpanStatus
3473+- description: <SchemaDefinition schemaRef="#/components/schemas/StructuredLogEvent"
3474+ />
3475+ name: StructuredLogEvent
3476+- description: <SchemaDefinition schemaRef="#/components/schemas/UnstructuredLogEvent"
3477+ />
3478+ name: UnstructuredLogEvent
3479+- description: <SchemaDefinition schemaRef="#/components/schemas/LogEventRequest"
3480+ />
3481+ name: LogEventRequest
41993482 - description: <SchemaDefinition schemaRef="#/components/schemas/DPOAlignmentConfig"
42003483 />
42013484 name: DPOAlignmentConfig
42023485 - description: <SchemaDefinition schemaRef="#/components/schemas/OptimizerConfig"
42033486 />
42043487 name: OptimizerConfig
4205-- description: 'Request to finetune a model.
4206-
4207-
4208- <SchemaDefinition schemaRef="#/components/schemas/PostTrainingRLHFRequest" />'
4209- name: PostTrainingRLHFRequest
42103488 - description: <SchemaDefinition schemaRef="#/components/schemas/RLHFAlgorithm" />
42113489 name: RLHFAlgorithm
42123490 - description: <SchemaDefinition schemaRef="#/components/schemas/TrainingConfig" />
42133491 name: TrainingConfig
4214-- description: <SchemaDefinition schemaRef="#/components/schemas/PostTrainingRLHFRequestWrapper"
3492+- description: <SchemaDefinition schemaRef="#/components/schemas/PreferenceOptimizeRequest"
42153493 />
4216- name: PostTrainingRLHFRequestWrapper
3494+ name: PreferenceOptimizeRequest
42173495 - description: <SchemaDefinition schemaRef="#/components/schemas/QueryDocumentsRequest"
42183496 />
42193497 name: QueryDocumentsRequest
@@ -4223,15 +3501,9 @@
42233501 - description: <SchemaDefinition schemaRef="#/components/schemas/DialogGenerations"
42243502 />
42253503 name: DialogGenerations
4226-- description: 'Request to score a reward function. A list of prompts and a list of
4227- responses per prompt.
4228-
4229-
4230- <SchemaDefinition schemaRef="#/components/schemas/RewardScoringRequest" />'
4231- name: RewardScoringRequest
4232-- description: <SchemaDefinition schemaRef="#/components/schemas/RewardScoringRequestWrapper"
4233- />
4234- name: RewardScoringRequestWrapper
3504+- description: <SchemaDefinition schemaRef="#/components/schemas/RewardScoreRequest"
3505+ />
3506+ name: RewardScoreRequest
42353507 - description: 'Response from the reward scoring. Batch of (prompt, response, score)
42363508 tuples that pass the threshold.
42373509
@@ -4243,12 +3515,9 @@
42433515 name: ScoredDialogGenerations
42443516 - description: <SchemaDefinition schemaRef="#/components/schemas/ScoredMessage" />
42453517 name: ScoredMessage
4246-- description: <SchemaDefinition schemaRef="#/components/schemas/RunShieldRequest"
3518+- description: <SchemaDefinition schemaRef="#/components/schemas/RunShieldsRequest"
42473519 />
4248- name: RunShieldRequest
4249-- description: <SchemaDefinition schemaRef="#/components/schemas/RunShieldRequestWrapper"
4250- />
4251- name: RunShieldRequestWrapper
3520+ name: RunShieldsRequest
42523521 - description: <SchemaDefinition schemaRef="#/components/schemas/RunShieldResponse"
42533522 />
42543523 name: RunShieldResponse
@@ -4261,27 +3530,15 @@
42613530 - description: <SchemaDefinition schemaRef="#/components/schemas/LoraFinetuningConfig"
42623531 />
42633532 name: LoraFinetuningConfig
4264-- description: 'Request to finetune a model.
4265-
4266-
4267- <SchemaDefinition schemaRef="#/components/schemas/PostTrainingSFTRequest" />'
4268- name: PostTrainingSFTRequest
42693533 - description: <SchemaDefinition schemaRef="#/components/schemas/QLoraFinetuningConfig"
42703534 />
42713535 name: QLoraFinetuningConfig
4272-- description: <SchemaDefinition schemaRef="#/components/schemas/PostTrainingSFTRequestWrapper"
4273- />
4274- name: PostTrainingSFTRequestWrapper
4275-- description: 'Request to generate synthetic data. A small batch of prompts and a
4276- filtering function
4277-
4278-
4279- <SchemaDefinition schemaRef="#/components/schemas/SyntheticDataGenerationRequest"
4280- />'
4281- name: SyntheticDataGenerationRequest
4282-- description: <SchemaDefinition schemaRef="#/components/schemas/SyntheticDataGenerationRequestWrapper"
3536+- description: <SchemaDefinition schemaRef="#/components/schemas/SupervisedFineTuneRequest"
42833537 />
4284- name: SyntheticDataGenerationRequestWrapper
3538+ name: SupervisedFineTuneRequest
3539+- description: <SchemaDefinition schemaRef="#/components/schemas/SyntheticDataGenerateRequest"
3540+ />
3541+ name: SyntheticDataGenerateRequest
42853542 - description: 'Response from the synthetic data generation. Batch of (prompt, response,
42863543 score) tuples that pass the threshold.
42873544
@@ -4292,24 +3549,6 @@
42923549 - description: <SchemaDefinition schemaRef="#/components/schemas/UpdateDocumentsRequest"
42933550 />
42943551 name: UpdateDocumentsRequest
4295-- description: <SchemaDefinition schemaRef="#/components/schemas/UpdateExperimentRequest"
4296- />
4297- name: UpdateExperimentRequest
4298-- description: <SchemaDefinition schemaRef="#/components/schemas/UpdateExperimentRequestWrapper"
4299- />
4300- name: UpdateExperimentRequestWrapper
4301-- description: <SchemaDefinition schemaRef="#/components/schemas/UpdateRunRequest"
4302- />
4303- name: UpdateRunRequest
4304-- description: <SchemaDefinition schemaRef="#/components/schemas/UpdateRunRequestWrapper"
4305- />
4306- name: UpdateRunRequestWrapper
4307-- description: <SchemaDefinition schemaRef="#/components/schemas/UploadArtifactRequest"
4308- />
4309- name: UploadArtifactRequest
4310-- description: <SchemaDefinition schemaRef="#/components/schemas/UploadArtifactRequestWrapper"
4311- />
4312- name: UploadArtifactRequestWrapper
43133552 x-tagGroups:
43143553 - name: Operations
43153554 tags:
@@ -4330,8 +3569,6 @@
43303569 - AgenticSystemCreateResponse
43313570 - AgenticSystemSessionCreateResponse
43323571 - AgenticSystemStepResponse
4333- - AgenticSystemTurnCreateRequest
4334- - AgenticSystemTurnCreateRequestWrapper
43353572 - AgenticSystemTurnResponseEvent
43363573 - AgenticSystemTurnResponseStepCompletePayload
43373574 - AgenticSystemTurnResponseStepProgressPayload
@@ -4339,21 +3576,17 @@
43393576 - AgenticSystemTurnResponseStreamChunk
43403577 - AgenticSystemTurnResponseTurnCompletePayload
43413578 - AgenticSystemTurnResponseTurnStartPayload
4342- - Artifact
4343- - ArtifactType
43443579 - Attachment
43453580 - BatchChatCompletionRequest
4346- - BatchChatCompletionRequestWrapper
43473581 - BatchChatCompletionResponse
43483582 - BatchCompletionRequest
4349- - BatchCompletionRequestWrapper
43503583 - BatchCompletionResponse
43513584 - BuiltinShield
43523585 - BuiltinTool
43533586 - CancelEvaluationJobRequest
43543587 - CancelTrainingJobRequest
43553588 - ChatCompletionRequest
4356- - ChatCompletionRequestWrapper
3589+ - ChatCompletionResponse
43573590 - ChatCompletionResponseEvent
43583591 - ChatCompletionResponseEventType
43593592 - ChatCompletionResponseStreamChunk
@@ -4361,17 +3594,13 @@
43613594 - CodeInterpreterToolDefinition
43623595 - CompletionMessage
43633596 - CompletionRequest
4364- - CompletionRequestWrapper
3597+ - CompletionResponse
43653598 - CompletionResponseStreamChunk
43663599 - CreateAgenticSystemRequest
43673600 - CreateAgenticSystemSessionRequest
3601+ - CreateAgenticSystemTurnRequest
43683602 - CreateDatasetRequest
4369- - CreateDatasetRequestWrapper
4370- - CreateExperimentRequest
4371- - CreateExperimentRequestWrapper
43723603 - CreateMemoryBankRequest
4373- - CreateRunRequest
4374- - CreateRunRequestWrapper
43753604 - DPOAlignmentConfig
43763605 - DeleteAgenticSystemRequest
43773606 - DeleteAgenticSystemSessionRequest
@@ -4383,36 +3612,25 @@
43833612 - EmbeddingsRequest
43843613 - EmbeddingsResponse
43853614 - EvaluateQuestionAnsweringRequest
4386- - EvaluateQuestionAnsweringRequestWrapper
43873615 - EvaluateSummarizationRequest
4388- - EvaluateSummarizationRequestWrapper
43893616 - EvaluateTextGenerationRequest
4390- - EvaluateTextGenerationRequestWrapper
43913617 - EvaluationJob
43923618 - EvaluationJobArtifactsResponse
43933619 - EvaluationJobLogStream
43943620 - EvaluationJobStatusResponse
4395- - Experiment
4396- - ExperimentStatus
43973621 - FinetuningAlgorithm
43983622 - FunctionCallToolDefinition
43993623 - GetAgenticSystemSessionRequest
44003624 - GetDocumentsRequest
44013625 - InferenceStep
44023626 - InsertDocumentsRequest
4403- - ListArtifactsRequest
4404- - Log
4405- - LogMessagesRequest
4406- - LogMessagesRequestWrapper
4407- - LogMetricsRequest
4408- - LogMetricsRequestWrapper
4409- - LogSearchRequest
4410- - LogSearchRequestWrapper
3627+ - LogEventRequest
3628+ - LogSeverity
44113629 - LoraFinetuningConfig
44123630 - MemoryBank
44133631 - MemoryBankDocument
44143632 - MemoryRetrievalStep
4415- - Metric
3633+ - MetricEvent
44163634 - OnViolationAction
44173635 - OptimizerConfig
44183636 - PhotogenToolDefinition
@@ -4421,23 +3639,17 @@
44213639 - PostTrainingJobLogStream
44223640 - PostTrainingJobStatus
44233641 - PostTrainingJobStatusResponse
4424- - PostTrainingRLHFRequest
4425- - PostTrainingRLHFRequestWrapper
4426- - PostTrainingSFTRequest
4427- - PostTrainingSFTRequestWrapper
3642+ - PreferenceOptimizeRequest
44283643 - QLoraFinetuningConfig
44293644 - QueryDocumentsRequest
44303645 - QueryDocumentsResponse
44313646 - RLHFAlgorithm
44323647 - RestAPIExecutionConfig
44333648 - RestAPIMethod
4434- - RewardScoringRequest
4435- - RewardScoringRequestWrapper
3649+ - RewardScoreRequest
44363650 - RewardScoringResponse
4437- - Run
4438- - RunShieldRequest
4439- - RunShieldRequestWrapper
44403651 - RunShieldResponse
3652+ - RunShieldsRequest
44413653 - SamplingParams
44423654 - SamplingStrategy
44433655 - ScoredDialogGenerations
@@ -4447,9 +3659,13 @@
44473659 - ShieldCallStep
44483660 - ShieldDefinition
44493661 - ShieldResponse
3662+ - SpanEndPayload
3663+ - SpanStartPayload
3664+ - SpanStatus
44503665 - StopReason
4451- - SyntheticDataGenerationRequest
4452- - SyntheticDataGenerationRequestWrapper
3666+ - StructuredLogEvent
3667+ - SupervisedFineTuneRequest
3668+ - SyntheticDataGenerateRequest
44533669 - SyntheticDataGenerationResponse
44543670 - SystemMessage
44553671 - TokenLogProbs
@@ -4463,17 +3679,13 @@
44633679 - ToolPromptFormat
44643680 - ToolResponse
44653681 - ToolResponseMessage
3682+ - Trace
44663683 - TrainEvalDataset
44673684 - TrainEvalDatasetColumnType
44683685 - TrainingConfig
44693686 - Turn
44703687 - URL
3688+ - UnstructuredLogEvent
44713689 - UpdateDocumentsRequest
4472- - UpdateExperimentRequest
4473- - UpdateExperimentRequestWrapper
4474- - UpdateRunRequest
4475- - UpdateRunRequestWrapper
4476- - UploadArtifactRequest
4477- - UploadArtifactRequestWrapper
44783690 - UserMessage
44793691 - WolframAlphaToolDefinition
modified rfcs/openapi_generator/pyopenapi/generator.py +3 −8
@@ -471,14 +471,9 @@
471471
472472 from dataclasses import make_dataclass
473473
474- if len(op.request_params) == 1 and "Request" in first[1].__name__:
475- # TODO(ashwin): Undo the "Request" hack and this entire block eventually
476- request_name = first[1].__name__ + "Wrapper"
477- request_type = make_dataclass(request_name, op.request_params)
478- else:
479- op_name = "".join(word.capitalize() for word in op.name.split("_"))
480- request_name = f"{op_name}Request"
481- request_type = make_dataclass(request_name, op.request_params)
474+ op_name = "".join(word.capitalize() for word in op.name.split("_"))
475+ request_name = f"{op_name}Request"
476+ request_type = make_dataclass(request_name, op.request_params)
482477
483478 requestBody = RequestBody(
484479 content={
modified tests/test_inference.py +6 −1
@@ -249,7 +249,12 @@
249249 stream=True,
250250 tools=[ToolDefinition(tool_name=BuiltinTool.brave_search)],
251251 )
252- iterator = self.api.chat_completion(request)
252+ iterator = self.api.chat_completion(
253+ request.model,
254+ request.messages,
255+ stream=request.stream,
256+ tools=request.tools,
257+ )
253258
254259 events = []
255260 async for chunk in iterator:
modified tests/test_ollama_inference.py +3 −1
@@ -61,7 +61,9 @@
6161 ],
6262 stream=False,
6363 )
64- iterator = self.api.chat_completion(request)
64+ iterator = self.api.chat_completion(
65+ request.model, request.messages, stream=request.stream
66+ )
6567 async for r in iterator:
6668 response = r
6769 print(response.completion_message.content)