Hi, there,
Sorry to bother you.
I am confuse about conversation with OpenGpts backend via APIs, because I am not lucky with successfully get results from most of them.
Even the example code from API.md.
I can make a successful call with following api but that's all:
async def get_assistant(assistant_id: str) -> Optional[Config]:
try:
response = requests.get(
f"{get_settings().opengpts_bk_uri}/assistants/{assistant_id}",
headers=api_headers,
)
if not response.ok:
return None
return Config(**response.json())
except Exception as error:
print("Failed to fetch assistant:", error)
return None
import asyncio
resp = asyncio.run(get_assistant_info(assistant_id))
print(resp.config)
If I try to get the list of assistants, it return an empty array:
curl -XGET http://backend:8000/assistants/
[]
If I try to get the information of a thread, it always turns "Thread not found":
import requests
requests.get(
'http://127.0.0.1:8100/threads/231dc7f3-33ee-4040-98fe-27f6e2aa8b2b/state',
cookies= {"opengpts_user_id": "foo"}
).content
b'{"detail":"Thread not found"}'
curl -XGET http://backend:8000/threads/23a56cc0-b6a9-41b1-8188-f78de0631713
{"detail":"Thread not found"}
I am pretty sure I have these records in the PostgresSQL storage:
Hi, there, Sorry to bother you. I am confuse about conversation with OpenGpts backend via APIs, because I am not lucky with successfully get results from most of them. Even the example code from API.md.
I can make a successful call with following api but that's all:
If I try to get the list of assistants, it return an empty array:
If I try to get the information of a thread, it always turns "Thread not found":
I am pretty sure I have these records in the PostgresSQL storage:
How can I make it smoothly? Any help are welcome, thank you.