Skip to content

Невозможно использовать агентов/исполнение функций #253

Open
@ropptar

Description

@ropptar

Пытаюсь создать агента, работающего на GigaChat.
Пользовался следующими примерами:

Внезависимости от метода, на выходе всегда получаю:

gigachat.exceptions.ResponseError: (URL('https://gigachat.devices.sberbank.ru/api/v1/chat/completions'), 422, b'{"status":422,"message":"Field \'properties.data.properties\' is missing"}\n', Headers({'server': 'SynGX',  ...
During task with name 'agent' and id '26dfe980-0f6a-6c89-b127-3f4ab60a0057'

Согласно #69, проблема в отсутствии поддержки функций, однако в документации написано, что все текущие модели ее имеют

Image

А preview-канал сейчас недоступен
Image


Код:

from langchain_gigachat.chat_models import GigaChat
from langchain_core.messages import HumanMessage
from langgraph.prebuilt import create_react_agent
from langgraph.checkpoint.memory import MemorySaver

from tools import tools

model = GigaChat(
    model="GigaChat-Pro",
)

memory=MemorySaver()
agent_executor=create_react_agent(model, tools, checkpointer=memory)

config = {"configurable": {"thread_id": "abc100"}}
for chunk in agent_executor.stream(
    {"messages": [HumanMessage(content="Привет! Меня зову Вася. Я живу в Москве")]},
    config,
):
    print(chunk)
    print("----")

for chunk in agent_executor.stream(
    {"messages": [HumanMessage(content="Узнай погоду в моем городе")]}, config
):
    print(chunk)
    print("----")

Установленные библиотеки:

> pip freeze
annotated-types==0.7.0
anyio==4.8.0
certifi==2025.1.31
charset-normalizer==3.4.1
gigachat==0.1.38
h11==0.14.0
httpcore==1.0.7
httpx==0.27.2
idna==3.10
jsonpatch==1.33
jsonpointer==3.0.0
langchain-core==0.3.43
langchain-gigachat==0.3.4
langgraph==0.3.5
langgraph-checkpoint==2.0.18
langgraph-prebuilt==0.1.2
langgraph-sdk==0.1.55
langsmith==0.3.13
msgpack==1.1.0
orjson==3.10.15
packaging==24.2
pydantic==2.10.6
pydantic_core==2.27.2
python-dotenv==1.0.1
PyYAML==6.0.2
requests==2.32.3
requests-toolbelt==1.0.0
sniffio==1.3.1
tenacity==9.0.0
types-requests==2.32.0.20250306
typing_extensions==4.12.2
urllib3==2.3.0
zstandard==0.23.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions