Skip to content

Commit eca7202

Browse files
jameszyaoSimsonW
authored andcommitted
fix: update enum and code version
1 parent fd1d40b commit eca7202

File tree

7 files changed

+20
-29
lines changed

7 files changed

+20
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ NUMBERS_API_SCHEMA = {
101101
# Create a tool action based on the defined schema
102102
actions = bulk_create_actions(
103103
schema=NUMBERS_API_SCHEMA,
104-
authentication=ActionAuthentication(type=ActionAuthenticationType.none)
104+
authentication=ActionAuthentication(type=ActionAuthenticationType.NONE)
105105
)
106106
action = actions[0]
107107
print(f"Action created: {action.id}")

examples/assistant/chat_with_assistant.ipynb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"actions: List[Action] = taskingai.tool.bulk_create_actions(\n",
9494
" schema=NUMBERS_API_SCHEMA,\n",
9595
" authentication=ActionAuthentication(\n",
96-
" type=ActionAuthenticationType.none,\n",
96+
" type=ActionAuthenticationType.NONE,\n",
9797
" )\n",
9898
")\n",
9999
"action = actions[0]\n",
@@ -291,16 +291,6 @@
291291
"collapsed": false
292292
},
293293
"id": "e94e3adb0d15373b"
294-
},
295-
{
296-
"cell_type": "code",
297-
"execution_count": null,
298-
"outputs": [],
299-
"source": [],
300-
"metadata": {
301-
"collapsed": false
302-
},
303-
"id": "6380260c47c9a4c"
304294
}
305295
],
306296
"metadata": {

examples/crud/tool_crud.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"actions: List[Action] = taskingai.tool.bulk_create_actions(\n",
102102
" schema=NUMBERS_API_SCHEMA,\n",
103103
" authentication=ActionAuthentication(\n",
104-
" type=ActionAuthenticationType.none,\n",
104+
" type=ActionAuthenticationType.NONE,\n",
105105
" )\n",
106106
")\n",
107107
"action = actions[0]\n",

taskingai/_version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
__title__ = "taskingai"
2-
__version__ = "0.0.7"
2+
__version__ = "0.0.9"
3+

taskingai/client/models/entity/assistant/assistant_memory.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55

66

77
class AssistantMemoryType(str, Enum):
8-
zero = "zero"
9-
naive = "naive"
10-
message_window = "message_window"
8+
ZERO = "zero"
9+
NAIVE = "naive"
10+
MESSAGE_WINDOW = "message_window"
1111

1212

1313
class AssistantMemory(BaseModel, ABC):
1414
type: AssistantMemoryType = Field(..., description="The type of the memory.")
1515

1616

1717
class AssistantMessageWindowMemory(AssistantMemory):
18-
type: AssistantMemoryType = Field(AssistantMemoryType.message_window, Literal=AssistantMemoryType.message_window)
18+
type: AssistantMemoryType = Field(AssistantMemoryType.MESSAGE_WINDOW, Literal=AssistantMemoryType.MESSAGE_WINDOW)
1919
max_messages: int = Field(...)
2020
max_tokens: int = Field(...)
2121

2222

2323
class AssistantNaiveMemory(AssistantMemory):
24-
type: AssistantMemoryType = Field(AssistantMemoryType.naive, Literal=AssistantMemoryType.naive)
24+
type: AssistantMemoryType = Field(AssistantMemoryType.NAIVE, Literal=AssistantMemoryType.NAIVE)
2525

2626

2727
class AssistantZeroMemory(AssistantMemory):
28-
type: AssistantMemoryType = Field(AssistantMemoryType.zero, Literal=AssistantMemoryType.zero)
28+
type: AssistantMemoryType = Field(AssistantMemoryType.ZERO, Literal=AssistantMemoryType.ZERO)
2929

3030

3131
def build_assistant_memory(memory_dict: Dict) -> Optional[AssistantMemory]:
@@ -35,15 +35,15 @@ def build_assistant_memory(memory_dict: Dict) -> Optional[AssistantMemory]:
3535

3636
memory_type = memory_dict['type']
3737

38-
if memory_type == AssistantMemoryType.zero.value:
38+
if memory_type == AssistantMemoryType.ZERO.value:
3939
# For zero memory, no additional information is needed
4040
return AssistantZeroMemory()
4141

42-
elif memory_type == AssistantMemoryType.naive.value:
42+
elif memory_type == AssistantMemoryType.NAIVE.value:
4343
# For naive memory, no additional configuration is needed
4444
return AssistantNaiveMemory()
4545

46-
elif memory_type == AssistantMemoryType.message_window.value:
46+
elif memory_type == AssistantMemoryType.MESSAGE_WINDOW.value:
4747
# For message window memory, additional configuration is needed
4848
max_messages = memory_dict.get('max_messages')
4949
max_tokens = memory_dict.get('max_tokens')

taskingai/client/models/entity/tool/action.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313

1414
class ActionAuthenticationType(str, Enum):
15-
basic = "basic"
16-
bearer = "bearer"
17-
custom = "custom"
18-
none = "none"
15+
BASIC = "basic"
16+
BEARER = "bearer"
17+
CUSTOM = "custom"
18+
NONE = "none"
1919

2020

2121
class ActionAuthentication(TaskingaiBaseModel):

taskingai/tool/action.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def bulk_create_actions(
138138
api_instance = get_api_instance(ModuleType.tool)
139139
if authentication is None:
140140
authentication = ActionAuthentication(
141-
type=ActionAuthenticationType.none,
141+
type=ActionAuthenticationType.NONE,
142142
)
143143
body = ActionBulkCreateRequest(
144144
schema=schema,
@@ -165,7 +165,7 @@ async def a_bulk_create_actions(
165165
api_instance = get_api_instance(ModuleType.tool, async_client=True)
166166
if authentication is None:
167167
authentication = ActionAuthentication(
168-
type=ActionAuthenticationType.none,
168+
type=ActionAuthenticationType.NONE,
169169
)
170170
body = ActionBulkCreateRequest(
171171
schema=schema,

0 commit comments

Comments
 (0)