Skip to content

Commit

Permalink
stream tool calling (#349)
Browse files Browse the repository at this point in the history
* add index field to ToolCall model

* Update test_specs.py with test_openai_spec_with_tools
  • Loading branch information
whisper-bye authored Oct 31, 2024
1 parent 1f96db5 commit 177f0ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/litserve/specs/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class FunctionCall(BaseModel):


class ToolCall(BaseModel):
index: int = 0
id: Optional[str] = None
type: str = "function"
function: FunctionCall
Expand Down
1 change: 1 addition & 0 deletions tests/test_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ async def test_openai_spec_with_tools(openai_request_data_with_tools):
"id": "call_1",
"type": "function",
"function": {"name": "function_1", "arguments": '{"arg_1": "arg_1_value"}'},
"index": 0,
}
], "LitAPI predict response should match with the generated output"

Expand Down

0 comments on commit 177f0ef

Please sign in to comment.