Issue Obtaining Agent Schema
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at the glean.client.agents.retrieve(agent_id="") call shown in the issue and compare its returned models with the documented and curl responses. Check how input_schema and output_schema are represented in the Python client. Done means the client response accurately exposes the agent schema returned by the endpoint, with coverage for the reported response shape.
Written by the indexing model from the issue text.
Description
When using this python block to obtain an agent's schema as hosted on the docs:
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
server_url="https://mycompany-be.glean.com",
) as glean:
res = glean.client.agents.retrieve(agent_id="<id>")
# Handle response
print(res)
This gives me this current output:
agent_id='3fc1d69087e84a.....' input_schema=InputSchema() output_schema=OutputSchema()
Which does not match for the list of an agents schema example response:
{
"agent_id": "mho4lwzylcozgoc2",
"name": "HR Policy Agent",
"input_schema": {},
"output_schema": {},
"tools": [
{
"tool_id": "string",
"display_name": "string",
"type": "string",
"auth_type": "string",
"write_action_type": "string",
"is_setup_finished": true,
"data_source": "string"
}
]
}
This is the response I receive when curling:
{"agent_id":"c491df2fb3........","name":"[Sales] UMF Advisor","input_schema":{},"output_schema":{"$defs":{"ContentType":{"description":"The type of content block.","enum":["text"],"type":"string"}},"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"messages":{"items":{"properties":{"content":{"description":"The content of the message.","items":{"properties":{"text":{"type":"string"},"type":{"$ref":"#/$defs/ContentType"}},"required":["text","type"],"title":"MessageTextBlock","type":"object"},"title":"Content","type":"array"},"role":{"description":"The role of the message.","title":"Role","type":"string"}},"title":"Message","type":"object"},"type":"array"}},"required":["messages"],"title":"AgentResponse","type":"object"}}
I understand that these api endpoints are in beta, but is there any communication about updates regarding this endpoint or the other ones regarding agents?
Thank you.
- Dominant language
- Python
- Stars
- 20
- Forks
- 10
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gleanwork/api-client-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gleanwork/api-client-python#136 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
gleanwork/api-client-python#133 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
gleanwork/api-client-python#115 · 4 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
gleanwork/api-client-python#105 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
gleanwork/api-client-python#57 · 2 comments ·
All issues in gleanwork/api-client-python
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100