Issue Obtaining Agent Schema

Abierto
#137 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python
Área
api

Línea de trabajo

Comienza con la llamada glean.client.agents.retrieve(agent_id="") mostrada en el issue y compara los modelos que devuelve con las respuestas documentadas y las respuestas de curl. Comprueba cómo se representan input_schema y output_schema en el cliente de Python. Se considera terminado cuando la respuesta del cliente expone correctamente el esquema del agente devuelto por el endpoint y existe cobertura para la estructura de respuesta indicada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
20
Forks
10
Merge medio
1 d 6 h
PR fusionados (30 d)
17

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de gleanwork/api-client-python

Todos los issues de gleanwork/api-client-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.