LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-sdk_asyncassistantsAssistantsClientget_schemas
    Method●Since v0.3

    get_schemas

    Copy
    get_schemas(
      self,
      assistant_id: str,
      *,
      headers: Mapping[str, str] |
    View source on GitHub
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    )
    ->
    GraphSchema

    Parameters

    NameTypeDescription
    assistant_id*str

    The ID of the assistant to get the schema of.

    headersMapping[str, str] | None
    Default:None

    Optional custom headers to include with the request.

    paramsQueryParamTypes | None
    Default:None

    Get the schemas of an assistant by ID.

    client = get_client(url="http://localhost:2024")
    schema = await client.assistants.get_schemas(
        assistant_id="my_assistant_id"
    )
    print(schema)
    
    ----------------------------------------------------------------------------------------------------------------------------
    
    {
        'graph_id': 'agent',
        'state_schema':
            {
                'title': 'LangGraphInput',
                '$ref': '#/definitions/AgentState',
                'definitions':
                    {
                        'BaseMessage':
                            {
                                'title': 'BaseMessage',
                                'description': 'Base abstract Message class. Messages are the inputs and outputs of ChatModels.',
                                'type': 'object',
                                'properties':
                                    {
                                     'content':
                                        {
                                            'title': 'Content',
                                            'anyOf': [
                                                {'type': 'string'},
                                                {'type': 'array','items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}
                                            ]
                                        },
                                    'additional_kwargs':
                                        {
                                            'title': 'Additional Kwargs',
                                            'type': 'object'
                                        },
                                    'response_metadata':
                                        {
                                            'title': 'Response Metadata',
                                            'type': 'object'
                                        },
                                    'type':
                                        {
                                            'title': 'Type',
                                            'type': 'string'
                                        },
                                    'name':
                                        {
                                            'title': 'Name',
                                            'type': 'string'
                                        },
                                    'id':
                                        {
                                            'title': 'Id',
                                            'type': 'string'
                                        }
                                    },
                                'required': ['content', 'type']
                            },
                        'AgentState':
                            {
                                'title': 'AgentState',
                                'type': 'object',
                                'properties':
                                    {
                                        'messages':
                                            {
                                                'title': 'Messages',
                                                'type': 'array',
                                                'items': {'$ref': '#/definitions/BaseMessage'}
                                            }
                                    },
                                'required': ['messages']
                            }
                    }
            },
        'context_schema':
            {
                'title': 'Context',
                'type': 'object',
                'properties':
                    {
                        'model_name':
                            {
                                'title': 'Model Name',
                                'enum': ['anthropic', 'openai'],
                                'type': 'string'
                            }
                    }
            }
    }

    Optional query parameters to include with the request.