Skip to content

Commit 9b7cbfc

Browse files
committed
fix: change tool to a dict
1 parent aedf04a commit 9b7cbfc

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ai21/clients/common/beta/assistant/assistants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def create(
2424
description: str | NotGiven = NOT_GIVEN,
2525
optimization: Optimization | NotGiven = NOT_GIVEN,
2626
models: List[str] | NotGiven = NOT_GIVEN,
27-
tools: List[Tool] | NotGiven = NOT_GIVEN,
27+
tools: List[dict[str, Tool]] | NotGiven = NOT_GIVEN,
2828
tool_resources: ToolResources | NotGiven = NOT_GIVEN,
2929
**kwargs,
3030
) -> AssistantResponse:
@@ -71,7 +71,7 @@ def modify(
7171
optimization: Optimization | NotGiven = NOT_GIVEN,
7272
is_archived: bool | NotGiven = NOT_GIVEN,
7373
models: List[str] | NotGiven = NOT_GIVEN,
74-
tools: List[Tool] | NotGiven = NOT_GIVEN,
74+
tools: List[dict[str, Tool]] | NotGiven = NOT_GIVEN,
7575
tool_resources: ToolResources | NotGiven = NOT_GIVEN,
7676
) -> AssistantResponse:
7777
pass

ai21/clients/studio/resources/beta/assistant/assistant.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def create(
3030
description: str | NotGiven = NOT_GIVEN,
3131
optimization: str | NotGiven = NOT_GIVEN,
3232
models: List[str] | NotGiven = NOT_GIVEN,
33-
tools: List[Tool] | NotGiven = NOT_GIVEN,
33+
tools: List[dict[str, Tool]] | NotGiven = NOT_GIVEN,
3434
tool_resources: ToolResources | NotGiven = NOT_GIVEN,
3535
**kwargs,
3636
) -> AssistantResponse:
@@ -61,7 +61,7 @@ def modify(
6161
optimization: str | NotGiven = NOT_GIVEN,
6262
is_archived: bool | NotGiven = NOT_GIVEN,
6363
models: List[str] | NotGiven = NOT_GIVEN,
64-
tools: List[Tool] | NotGiven = NOT_GIVEN,
64+
tools: List[dict[str, Tool]] | NotGiven = NOT_GIVEN,
6565
tool_resources: ToolResources | NotGiven = NOT_GIVEN,
6666
) -> AssistantResponse:
6767
body = self._create_body(
@@ -94,7 +94,7 @@ async def create(
9494
description: str | NotGiven = NOT_GIVEN,
9595
optimization: str | NotGiven = NOT_GIVEN,
9696
models: List[str] | NotGiven = NOT_GIVEN,
97-
tools: List[Tool] | NotGiven = NOT_GIVEN,
97+
tools: List[dict[str, Tool]] | NotGiven = NOT_GIVEN,
9898
tool_resources: ToolResources | NotGiven = NOT_GIVEN,
9999
**kwargs,
100100
) -> AssistantResponse:
@@ -125,7 +125,7 @@ async def modify(
125125
optimization: str | NotGiven = NOT_GIVEN,
126126
is_archived: bool | NotGiven = NOT_GIVEN,
127127
models: List[str] | NotGiven = NOT_GIVEN,
128-
tools: List[Tool] | NotGiven = NOT_GIVEN,
128+
tools: List[dict[str, Tool]] | NotGiven = NOT_GIVEN,
129129
tool_resources: ToolResources | NotGiven = NOT_GIVEN,
130130
) -> AssistantResponse:
131131
body = self._create_body(

ai21/models/responses/assistant_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from datetime import datetime
2-
from typing import Optional, List, Literal
2+
from typing import Optional, List, Literal, Any
33

44
from ai21.models.ai21_base_model import AI21BaseModel
55
from ai21.models.assistant.assistant import ToolResources
@@ -18,7 +18,7 @@ class AssistantResponse(AI21BaseModel):
1818
avatar: Optional[str] = None
1919
is_archived: bool = False
2020
models: Optional[List[str]] = None
21-
tools: Optional[List[str]] = None
21+
tools: Optional[List[dict[str, Any]]] = None
2222
tool_resources: Optional[ToolResources] = None
2323

2424

0 commit comments

Comments
 (0)