Python SDK - Testing with your Github Examples

Hello
I am testing the Assistant creation, from this url TaskingAI-Python-Client/examples/assistant/chat_with_assistant.ipynb at master · TaskingAI/TaskingAI-Python-Client · GitHub

I encountered a json validation issue which finally passed this way
“openapi”: “3.0.0”,
“info”: {
“title”: “Numbers API”,
“version”: “1.0.0”,
“description”: “API for fetching interesting number facts”
},
“servers”: [
{
“url”: “http://numbersapi.com
}
],
“paths”: {
“/{number}”: {
“get”: {
“description”: “Get a fact about a number”,
“operationId”: “getNumberFact”,
“parameters”: [
{
“name”: “number”,
“in”: “path”,
“required”: True,
“description”: “The number to get the fact for”,
“schema”: {
“type”: “integer”
}
}
],
“responses”: {
“200”: {
“description”: “A fact about the number”,
“content”: {
“text/plain”: {
“schema”: {
“type”: “string”
}
}
}
}
}
}
}
}
}

The following instruction:

actions: List[Action] = taskingai.tool.bulk_create_actions(
    openapi_schema=NUMBERS_API_SCHEMA,
    authentication=ActionAuthentication(
        type=ActionAuthenticationType.NONE,
    )
)
action = actions[0]
print(f"created action: {action}\n")

give me this error : 

ApiException: (401)
Reason: Unauthorized
HTTP response headers: Headers({‘date’: ‘Sat, 25 May 2024 07:20:32 GMT’, ‘content-type’: ‘application/json’, ‘content-length’: ‘100’, ‘connection’: ‘keep-alive’, ‘server’: ‘uvicorn’, ‘x-kong-upstream-latency’: ‘3’, ‘x-kong-proxy-latency’: ‘5’, ‘via’: ‘kong/3.5.0’, ‘x-kong-request-id’: ‘014a9119054fe40e834b1214a2d12a10’})
HTTP response body: b’{“status”:“error”,“error”:{“code”:“APIKEY_VALIDATION_FAILED”,“message”:“API Key validation failed”}}’

Can you please help, I am testing the SDK on Colab. The OPENAI_API_KEY and TASKINGAI_API_KEY are setup as global variables.  I was able to integrate the JSON code above with the TaskingAI interface (action) and the new assistant I created through the interface worked successfully.  Will appreciate your help and support,

Hello, I didn’t find any issues after executing the code from your GitHub, and the action can be created smoothly. Of course, I can’t verify whether your API_KEY is correct, so I suggest you confirm the TASKINGAI_API_KEY you obtained through userdata locally.

Hello,

Thank you for testing it.
I just did a new notebook on Colab for testing again, taskingai/taskingai_creation_assistant.ipynb at main · royam0820/taskingai · GitHub
with this one I did not have any APIs issues. I will check again, may be I reached a limit in the number of plugins and collections I can do on a free subscription?

Hi Royam, glad to see your code is working as expected. Based on the error message you shared, it is not likely that the issue was caused by limits of your account, but rather some issues with the environmental variable settings. Please make sure the API Key is properly set.