ai-forever / ai-forever/langchain-gigachat

Bug: langchain-gigachat strips critical JSON Schema fields, breaking tool calling

オープン
#55 コメント 1 件 リアクション 5 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
50
フォーク
13
PR マージ指標
30日以内にマージされた PR はありません

説明

### Description
The `_convert_function_to_dict` function (line 302-303) only preserves `type` and `description` from parameter schemas, stripping essential fields like `items` (for arrays) and `additionalProperties` (for objects). This produces invalid schemas that GigaChat API rejects with 422 errors.

### Impact
- Breaks ALL MCP servers with array/object parameters
- Makes langchain-gigachat incompatible with standard OpenAI tool schemas

### Example
**Input schema:**
{
"file_ids": {
"type": "array",
"items": {"type": "string"}
},
"metadata": {
"type": "object",
"additionalProperties": true
}
}**What langchain-gigachat sends to GigaChat:**
{
"file_ids": {"type": "array"}, // ❌ Missing items
"metadata": {"type": "object"} // ❌ Missing additionalProperties
}**GigaChat response:**
- `422: "Type properties.file_ids.items.type is wrong"`
- `422: "Field 'properties.metadata.properties' is missing"`

### Fix
Preserve all JSON Schema fields, not just `type` and `description`.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。