Files
obsidian-vault/personal/projects/balda/fix-openaimodel-tools.md
T

18 lines
951 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# План: фикс MCP для OpenAIModel
## Что сделать
1. В `openAIChatRequest` добавить поле `Tools []openAIToolDefinition`
2. Структура `openAIToolDefinition` (name, description, input_schema)
3. В `buildChatRequest` — прочитать `req.Config.Tools` из `genai` конфига, сконвертировать в OpenAI tool definitions
4. В `parseChatResponse` — парсить `tool_calls` из ответа (message может содержать и content, и tool_calls)
5. Написать тесты
## Тесты покрывают:
- `buildChatRequest` с tools и без
- `parseChatResponse` с tool_calls, с content, с обоими
- Интеграционный: `OpenAIModel.generate()` с мок-сервером
## Риски
- GenAI `Tool` структура — как конвертировать в OpenAI tool definition
- `tool_calls` формат в ответе DeepSeek