Skip to content

Commit 9778177

Browse files
jameszyaoSimsonW
authored andcommitted
feat: update async client
1 parent cba79e3 commit 9778177

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

examples/assistant/chat_with_assistant.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"execution_count": null,
4343
"outputs": [],
4444
"source": [
45-
"from taskingai.tool import Action, ActionAuthentication, ActionAuthenticationType\n",
45+
"from taskingai.models import Action, ActionAuthentication, ActionAuthenticationType\n",
4646
"from typing import List\n",
4747
"\n",
4848
"# create an assistant action\n",
@@ -109,7 +109,7 @@
109109
"execution_count": null,
110110
"outputs": [],
111111
"source": [
112-
"from taskingai.assistant import Assistant, Chat, AssistantTool, AssistantToolType\n",
112+
"from taskingai.models import Assistant, Chat, ToolRef, ToolType\n",
113113
"from taskingai.assistant.memory import AssistantMessageWindowMemory\n",
114114
"\n",
115115
"# choose an available chat_completion model from your project\n",
@@ -128,12 +128,12 @@
128128
" \"No matter what the user's language is, you will use the {{langugae}} to explain.\"\n",
129129
" ],\n",
130130
" tools=[\n",
131-
" AssistantTool(\n",
132-
" type=AssistantToolType.ACTION,\n",
131+
" ToolRef(\n",
132+
" type=ToolType.ACTION,\n",
133133
" id=action.action_id,\n",
134134
" ), \n",
135-
" AssistantTool(\n",
136-
" type=AssistantToolType.ACTION,\n",
135+
" ToolRef(\n",
136+
" type=ToolType.ACTION,\n",
137137
" id=action.action_id,\n",
138138
" )\n",
139139
" ],\n",

examples/crud/assistant_crud.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"metadata": {},
2626
"outputs": [],
2727
"source": [
28-
"from taskingai.assistant import Assistant, Chat\n",
28+
"from taskingai.models import Assistant, Chat\n",
2929
"from taskingai.assistant.memory import AssistantNaiveMemory\n",
3030
"\n",
3131
"# choose an available chat_completion model from your project\n",

taskingai/client/api_client.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -485,28 +485,18 @@ async def __call_api(
485485

486486
# path parameters
487487
if path_params:
488-
path_params = self.parameters_to_tuples(path_params, collection_formats)
489-
for k, v in path_params:
488+
for k, v in path_params.items():
490489
# specified safe chars, encode everything
491490
resource_path = resource_path.replace("{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param))
492491

493-
# query parameters
494-
if query_params:
495-
query_params = self.sanitize_for_serialization(query_params)
496-
query_params = self.parameters_to_tuples(query_params, collection_formats)
497-
498492
# post parameters
499493
if post_params or files:
500494
post_params = self.prepare_post_parameters(post_params, files)
501-
post_params = self.sanitize_for_serialization(post_params)
502-
post_params = self.parameters_to_tuples(post_params, collection_formats)
503495

504496
# auth setting
505497
self.update_params_for_auth(header_params, query_params, auth_settings)
506498

507499
# body
508-
if body:
509-
body = self.sanitize_for_serialization(body)
510500

511501
# request url
512502
url = self.configuration.host + resource_path
@@ -515,7 +505,7 @@ async def __call_api(
515505
response_data = await self.request(
516506
method,
517507
url,
518-
stream,
508+
stream=stream,
519509
query_params=query_params,
520510
headers=header_params,
521511
post_params=post_params,

taskingai/models.py

Whitespace-only changes.

0 commit comments

Comments
 (0)