首页 / AI教程 / 正文
AI教程

Ollama教程:快速上手LLaVA图片描述、API调用与LangChain智能体

chuanbook chuanbook
发布于 2026 年 10 月 06 日
阅读 约2分钟
浏览 4
评论 0

ollama --version ollama list

ollama run llava >>> 描述这张图片 /path/to/image.jpg

curl http://localhost:11434/api/generate -d '{ "model": "qwen2.5:7b", "prompt": "用一句话解释什么是REST API", "stream": false }'

from langchain_core.tools import tool from langchain.agents import create_tool_calling_agent, AgentExecutor

@tool def search_docs(query: str) -> str:

"""在企业文档库中搜索,输入是搜索关键词"""
return retriever.invoke(query)[0].page_content

tools = [search_docs] agent = create_tool_calling_agent(llm, tools, prompt) executor = AgentExecutor(agent=agent, tools=tools, verbose=True) executor.invoke({"input": "公司的报销流程是什么?"})

赞0
踩0
☆收藏0
版权声明
文章版权声明:除非注明,否则均为ZBLOG原创文章,转载或复制请以超链接形式并注明出处。
分享到
chuanbook

链接已复制到剪贴板