3. 编辑 config/config.toml 添加 API 密钥和自定义设置:(注: model和base_url在deepseek充值界面接口文档就可以看到)
# Global LLM configuration [llm] model = "deepseek-chat" base_url = "https://api.deepseek.com" api_key = "sk-8.....9ff89" max_tokens = 4096 temperature = 0.0
# [llm] #AZURE OPENAI: # api_type= 'azure' # model = "YOUR_MODEL_NAME" #"gpt-4o-mini" # base_url = "{YOUR_AZURE_ENDPOINT.rstrip('/')}/openai/deployments/{AZURE_DEPOLYMENT_ID}" # api_key = "AZURE API KEY" # max_tokens = 8096 # temperature = 0.0 # api_version="AZURE API VERSION" #"2024-08-01-preview"
# Optional configuration for specific LLM models [llm.vision] model = "claude-3-5-sonnet" base_url = "https://api.openai.com/v1" api_key = "sk-..."
启动
1
python main.py
输出如下:
1 2 3 4
INFO [browser_use] BrowserUse logging setup complete with level info INFO [root] Anonymized telemetry enabled. See https://docs.browser-use.com/development/telemetry for more information. Enter your prompt (or 'exit'/'quit' to quit): (这里就是发挥创意的地方了)
for result in soup.select('.b_algo'): link = result.find('a', href=True) if link and'href'in link.attrs: links.append(link['href']) iflen(links) >= num_results: return links rst = links[:num_results] return rst
from app.agent.toolcall import ToolCallAgent from app.prompt.manus import NEXT_STEP_PROMPT, SYSTEM_PROMPT from app.tool import Terminate, ToolCollection from app.tool.browser_use_tool import BrowserUseTool from app.tool.file_saver import FileSaver from app.tool.google_search import GoogleSearch # 一定要先引入 from app.tool.bing_search import BingSearch from app.tool.python_execute import PythonExecute
classManus(ToolCallAgent): """ A versatile general-purpose agent that uses planning to solve various tasks. This agent extends PlanningAgent with a comprehensive set of tools and capabilities, including Python execution, web browsing, file operations, and information retrieval to handle a wide range of user requests. """
name: str = "Manus" description: str = ( "A versatile agent that can solve various tasks using multiple tools" )
ollama run qwen2:1.5b >>> who are you? I am an AI language model, designed to answer questions and provide information on various topics. How can I assist you today?
NAME ID SIZE PROCESSOR UNTIL qwen2:1.5b f6daf2b25194 1.5 GB 100% CPU 4 minutes from now milkey/m3e:latest 1477f12451b0 860 MB 100% CPU 4 minutes from now
from langchain_community.document_loaders import DirectoryLoader from langchain_community.vectorstores import Milvus from langchain_ollama import OllamaEmbeddings from langchain_text_splitters import RecursiveCharacterTextSplitter from pymilvus import MilvusClient import os
from langchain.chains import create_retrieval_chain from langchain.chains.combine_documents import create_stuff_documents_chain from langchain_community.vectorstores import Milvus from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_ollama import OllamaEmbeddings from langchain_ollama import OllamaLLM from langchain_text_splitters import RecursiveCharacterTextSplitter from pymilvus import MilvusClient
# 创建提示词模版 prompt = ChatPromptTemplate.from_template( """Answer the following question based only on the provided context: <context> {context} </context> Question: {input}""" )
CopyQ is clipboard manager – a desktop application which stores content of the system clipboard whenever it changes and allows to search the history and copy it back to the system clipboard or paste it directly to other applications.