gleanwork / gleanwork/api-client-python
Issue Obtaining Agent Schema
未關閉
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 20
- 分支
- 10
- 平均合併
- 1 天 6 小時
- 30 天內合併 PR
- 17
描述
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.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 issue 中所示的 glean.client.agents.retrieve(agent_id="") 呼叫開始,並將其回傳的模型與文件中的回應以及 curl 回應進行比較。檢查 input_schema 和 output_schema 在 Python client 中的表示方式。當 client response 準確公開 endpoint 回傳的 agent schema,並涵蓋所回報的 response shape 時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100