# langchain_agent **Repository Path**: zhengxingne/langchain_agent ## Basic Information - **Project Name**: langchain_agent - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-23 - **Last Updated**: 2026-02-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OpenAI 工具调用流式输出示例 这是一个使用 HTTP 请求调用 OpenAI 代理 API 的简单示例,支持工具调用和流式输出。 ## 功能特点 - ✅ 使用 HTTP 请求调用 OpenAI 兼容 API - ✅ 支持工具调用(Function Calling) - ✅ 流式输出最终结果 - ✅ 简单的天气查询工具示例 ## 安装依赖 ```bash pip install -r requirements.txt ``` ## 运行示例 ```bash python tool_call_stream.py ``` ## 工作流程 1. 用户发送问题(例如:"北京今天天气怎么样?") 2. AI 判断需要调用工具并返回工具调用信息 3. 程序执行工具函数获取结果 4. 将工具结果发送回 AI 5. AI 以流式方式输出最终回复 ## 自定义 你可以在 `tools` 列表中添加更多工具,并在 `call_tool` 函数中实现相应的逻辑。