Skip to content

Commit 7987001

Browse files
committed
fix: update new interface usage example
1 parent 871fd50 commit 7987001

File tree

2 files changed

+30
-26
lines changed

2 files changed

+30
-26
lines changed

examples/assistant/chat_with_assistant.ipynb

+26-26
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": null,
65
"id": "initial_id",
76
"metadata": {
87
"collapsed": true
98
},
10-
"outputs": [],
119
"source": [
1210
"import time\n",
1311
"import taskingai\n",
1412
"# Load TaskingAI API Key from environment variable"
15-
]
13+
],
14+
"outputs": [],
15+
"execution_count": null
1616
},
1717
{
1818
"cell_type": "markdown",
@@ -39,10 +39,8 @@
3939
},
4040
{
4141
"cell_type": "code",
42-
"execution_count": null,
43-
"outputs": [],
4442
"source": [
45-
"from taskingai.models import Action, ActionAuthentication, ActionAuthenticationType\n",
43+
"from taskingai.tool import Action, ActionAuthentication, ActionAuthenticationType\n",
4644
"from typing import List\n",
4745
"\n",
4846
"# create an assistant action\n",
@@ -102,14 +100,14 @@
102100
"metadata": {
103101
"collapsed": false
104102
},
105-
"id": "3b2fda39ba58c5e9"
103+
"id": "3b2fda39ba58c5e9",
104+
"outputs": [],
105+
"execution_count": null
106106
},
107107
{
108108
"cell_type": "code",
109-
"execution_count": null,
110-
"outputs": [],
111109
"source": [
112-
"from taskingai.models import Assistant, Chat, ToolRef, ToolType\n",
110+
"from taskingai.assistant import Assistant, Chat, ToolRef, ToolType\n",
113111
"from taskingai.assistant.memory import AssistantMessageWindowMemory\n",
114112
"\n",
115113
"# choose an available chat_completion model from your project\n",
@@ -145,7 +143,9 @@
145143
"metadata": {
146144
"collapsed": false
147145
},
148-
"id": "3b3df0f232021283"
146+
"id": "3b3df0f232021283",
147+
"outputs": [],
148+
"execution_count": null
149149
},
150150
{
151151
"cell_type": "markdown",
@@ -159,8 +159,6 @@
159159
},
160160
{
161161
"cell_type": "code",
162-
"execution_count": null,
163-
"outputs": [],
164162
"source": [
165163
"chat: Chat = taskingai.assistant.create_chat(\n",
166164
" assistant_id=assistant.assistant_id,\n",
@@ -170,12 +168,12 @@
170168
"metadata": {
171169
"collapsed": false
172170
},
173-
"id": "f1e2f0b2af8b1d8d"
171+
"id": "f1e2f0b2af8b1d8d",
172+
"outputs": [],
173+
"execution_count": null
174174
},
175175
{
176176
"cell_type": "code",
177-
"execution_count": null,
178-
"outputs": [],
179177
"source": [
180178
"from taskingai.assistant import Message, MessageChunk\n",
181179
"user_input = input(\"User Input: \")\n",
@@ -204,12 +202,12 @@
204202
"metadata": {
205203
"collapsed": false
206204
},
207-
"id": "b26e30b79b71697a"
205+
"id": "b26e30b79b71697a",
206+
"outputs": [],
207+
"execution_count": null
208208
},
209209
{
210210
"cell_type": "code",
211-
"execution_count": null,
212-
"outputs": [],
213211
"source": [
214212
"user_input = input(\"User Input: \")\n",
215213
"while user_input.strip() and user_input != \"q\":\n",
@@ -245,12 +243,12 @@
245243
"metadata": {
246244
"collapsed": false
247245
},
248-
"id": "c7d73e0b138e3eba"
246+
"id": "c7d73e0b138e3eba",
247+
"outputs": [],
248+
"execution_count": null
249249
},
250250
{
251251
"cell_type": "code",
252-
"execution_count": null,
253-
"outputs": [],
254252
"source": [
255253
"# list messages\n",
256254
"messages = taskingai.assistant.list_messages(\n",
@@ -264,12 +262,12 @@
264262
"metadata": {
265263
"collapsed": false
266264
},
267-
"id": "e94e3adb0d15373b"
265+
"id": "e94e3adb0d15373b",
266+
"outputs": [],
267+
"execution_count": null
268268
},
269269
{
270270
"cell_type": "code",
271-
"execution_count": null,
272-
"outputs": [],
273271
"source": [
274272
"# delete assistant\n",
275273
"taskingai.assistant.delete_assistant(\n",
@@ -279,7 +277,9 @@
279277
"metadata": {
280278
"collapsed": false
281279
},
282-
"id": "ed39836bbfdc7a4e"
280+
"id": "ed39836bbfdc7a4e",
281+
"outputs": [],
282+
"execution_count": null
283283
}
284284
],
285285
"metadata": {

taskingai/assistant/assistant.py

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"AssistantTool",
88
"AssistantRetrieval",
99
"AssistantToolType",
10+
"ToolRef",
11+
"ToolType",
12+
"RetrievalRef",
13+
"RetrievalType",
1014
"AssistantRetrievalType",
1115
"get_assistant",
1216
"list_assistants",

0 commit comments

Comments
 (0)