API definition mismatch
kgrofelnik opened this issue · comments
Krešimir Grofelnik commented
I've created an agent using the admin interface and tried using it with the SDK.
It seems there's an entity definition mismatch.
SDK version 0.1.36
Traceback (most recent call last):
File ".../main.py", line 5, in <module>
agent = client.agent.get("XXXXXX")
File ".../lib/python3.10/site-packages/superagent/resources/agent/client.py", line 89, in get
return pydantic.parse_obj_as(AppModelsResponseAgent, _response.json()) # type: ignore
File ".../lib/python3.10/site-packages/pydantic/v1/tools.py", line 38, in parse_obj_as
return model_type(__root__=obj).__root__
File ".../lib/python3.10/site-packages/pydantic/v1/main.py", line 341, in __init__
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for ParsingModel[AppModelsResponseAgent]
__root__ -> data -> llms -> 0 -> llm -> options
Ismail Pelaseyed commented
Did you add an llm to the agent? @kgrofelnik
Ismail Pelaseyed commented
@kgrofelnik This works for me:
response = client.agent.invoke(
agent_id="XXXX",
input="Hi, there",
enable_streaming=False
)
print(response.data.get("output"))
Please confirm that the Agent you setup has an LLM attached to it. Also if the issue persists I would be glad to jump on DM on Discord to help debug. Here is the link to join: https://discord.gg/mhmJUTjW4b
Krešimir Grofelnik commented
Ismail Pelaseyed commented
@kgrofelnik thank u! Debugging.
Ismail Pelaseyed commented
What sdk function are you running? client.agent.get
?
Ismail Pelaseyed commented
@kgrofelnik should also be fixed in the latest release of the SDK.