From 2608badc0285e2dee96b495347b4538d7bbb4dd2 Mon Sep 17 00:00:00 2001 From: DavdGao Date: Mon, 13 Jan 2025 12:05:30 +0800 Subject: [PATCH] Update the tutorial links --- README.md | 66 ++--- README_JA.md | 64 ++--- README_ZH.md | 64 ++--- docs/news_en.md | 12 +- docs/news_ja.md | 12 +- docs/news_zh.md | 12 +- .../conversation_in_stream_mode/README.md | 2 +- .../conversation_nl2sql/react_nl2sql.ipynb | 2 +- .../codeact_agent_example_modeling.ipynb | 2 +- .../codeact_agent_example_tools.ipynb | 2 +- .../main.ipynb | 2 +- .../conversation_with_react_agent/main.ipynb | 2 +- .../conversation_with_swe-agent/main.ipynb | 4 +- examples/game_werewolf/README.md | 8 +- src/agentscope/agents/agent.py | 2 +- src/agentscope/agents/dict_dialog_agent.py | 2 +- src/agentscope/models/dashscope_model.py | 237 +++++++++--------- src/agentscope/models/gemini_model.py | 19 +- src/agentscope/models/litellm_model.py | 37 +-- src/agentscope/models/ollama_model.py | 85 ++++--- src/agentscope/models/openai_model.py | 115 ++++----- src/agentscope/models/yi_model.py | 47 ++-- src/agentscope/models/zhipu_model.py | 84 ++++--- 23 files changed, 421 insertions(+), 461 deletions(-) diff --git a/README.md b/README.md index 1e65a0b1c..474a9b988 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ AgentScope is an innovative multi-agent platform designed to empower developers to build multi-agent applications with large-scale models. It features three high-level capabilities: -- 🤝 **Easy-to-Use**: Designed for developers, with [fruitful components](https://modelscope.github.io/agentscope/en/tutorial/204-service.html#), -[comprehensive documentation](https://modelscope.github.io/agentscope/en/index.html), and broad compatibility. Besides, [AgentScope Workstation](https://agentscope.io/) provides a *drag-and-drop programming platform* and a *copilot* for beginners of AgentScope! +- 🤝 **Easy-to-Use**: Designed for developers, with [fruitful components](https://doc.agentscope.io/build_tutorial/tool.html#), +[comprehensive documentation](https://doc.agentscope.io/), and broad compatibility. Besides, [AgentScope Workstation](https://agentscope.io/) provides a *drag-and-drop programming platform* and a *copilot* for beginners of AgentScope! - ✅ **High Robustness**: Supporting customized fault-tolerance controls and retry mechanisms to enhance application stability. @@ -78,26 +78,26 @@ applications in a centralized programming manner for streamlined development. AgentScope provides a list of `ModelWrapper` to support both local model services and third-party model APIs. -| API | Task | Model Wrapper | Configuration | Some Supported Models | -|------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| -| OpenAI API | Chat | [`OpenAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_chat_template.json) | gpt-4o, gpt-4, gpt-3.5-turbo, ... | -| | Embedding | [`OpenAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_embedding_template.json) | text-embedding-ada-002, ... | -| | DALL·E | [`OpenAIDALLEWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_dall_e_template.json) | dall-e-2, dall-e-3 | -| DashScope API | Chat | [`DashScopeChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_chat_template.json) | qwen-plus, qwen-max, ... | -| | Image Synthesis | [`DashScopeImageSynthesisWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_image_synthesis_template.json) | wanx-v1 | -| | Text Embedding | [`DashScopeTextEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_text_embedding_template.json) | text-embedding-v1, text-embedding-v2, ... | -| | Multimodal | [`DashScopeMultiModalWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_multimodal_template.json) | qwen-vl-max, qwen-vl-chat-v1, qwen-audio-chat | -| Gemini API | Chat | [`GeminiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#gemini-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_chat_template.json) | gemini-pro, ... | -| | Embedding | [`GeminiEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#gemini-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_embedding_template.json) | models/embedding-001, ... | -| ZhipuAI API | Chat | [`ZhipuAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#zhipu-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_chat_template.json) | glm-4, ... | -| | Embedding | [`ZhipuAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#zhipu-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_embedding_template.json) | embedding-2, ... | -| ollama | Chat | [`OllamaChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_chat_template.json) | llama3, llama2, Mistral, ... | -| | Embedding | [`OllamaEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_embedding_template.json) | llama2, Mistral, ... | -| | Generation | [`OllamaGenerationWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_generate_template.json) | llama2, Mistral, ... | -| LiteLLM API | Chat | [`LiteLLMChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/litellm_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#litellm-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/litellm_chat_template.json) | [models supported by litellm](https://docs.litellm.ai/docs/)... | -| Yi API | Chat | [`YiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/yi_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/yi_chat_template.json) | yi-large, yi-medium, ... | -| Post Request based API | - | [`PostAPIModelWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/post_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#post-request-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/postapi_model_config_template.json) | - | -| Anthropic API | Chat | [`AnthropicChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/anthropic_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#anthropic-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/anthropic_chat_model_config_template.json) | claude-3-5-sonnet-20241022, ... | +| API | Task | Model Wrapper | Configuration | Some Supported Models | +|------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| +| OpenAI API | Chat | [`OpenAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_chat_template.json) | gpt-4o, gpt-4, gpt-3.5-turbo, ... | +| | Embedding | [`OpenAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_embedding_template.json) | text-embedding-ada-002, ... | +| | DALL·E | [`OpenAIDALLEWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_dall_e_template.json) | dall-e-2, dall-e-3 | +| DashScope API | Chat | [`DashScopeChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_chat_template.json) | qwen-plus, qwen-max, ... | +| | Image Synthesis | [`DashScopeImageSynthesisWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_image_synthesis_template.json) | wanx-v1 | +| | Text Embedding | [`DashScopeTextEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_text_embedding_template.json) | text-embedding-v1, text-embedding-v2, ... | +| | Multimodal | [`DashScopeMultiModalWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_multimodal_template.json) | qwen-vl-max, qwen-vl-chat-v1, qwen-audio-chat | +| Gemini API | Chat | [`GeminiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_chat_template.json) | gemini-pro, ... | +| | Embedding | [`GeminiEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_embedding_template.json) | models/embedding-001, ... | +| ZhipuAI API | Chat | [`ZhipuAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_chat_template.json) | glm-4, ... | +| | Embedding | [`ZhipuAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_embedding_template.json) | embedding-2, ... | +| ollama | Chat | [`OllamaChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_chat_template.json) | llama3, llama2, Mistral, ... | +| | Embedding | [`OllamaEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_embedding_template.json) | llama2, Mistral, ... | +| | Generation | [`OllamaGenerationWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_generate_template.json) | llama2, Mistral, ... | +| LiteLLM API | Chat | [`LiteLLMChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/litellm_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/litellm_chat_template.json) | [models supported by litellm](https://docs.litellm.ai/docs/)... | +| Yi API | Chat | [`YiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/yi_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/yi_chat_template.json) | yi-large, yi-medium, ... | +| Post Request based API | - | [`PostAPIModelWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/post_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/postapi_model_config_template.json) | - | +| Anthropic API | Chat | [`AnthropicChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/anthropic_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/anthropic_chat_model_config_template.json) | claude-3-5-sonnet-20241022, ... | **Supported Local Model Deployment** @@ -188,7 +188,7 @@ pip install agentscope To support different deployment scenarios, AgentScope provides several optional dependencies. Full list of optional dependencies refers to -[tutorial](https://doc.agentscope.io/en/tutorial/102-installation.html) +[tutorial](https://doc.agentscope.io/build_tutorial/quickstart.html) Taking distribution mode as an example, you can install its dependencies as follows: @@ -299,30 +299,12 @@ AgentScope provides an easy-to-use runtime user interface capable of displaying multimodal output on the front end, including text, images, audio and video. -Refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/209-gui.html) for more details. +Refer to our [tutorial](https://doc.agentscope.io/build_tutorial/visual.html) for more details.
agentscope-logo
-## Tutorial - -- [About AgentScope](https://modelscope.github.io/agentscope/zh_CN/tutorial/101-agentscope.html) -- [Installation](https://modelscope.github.io/agentscope/zh_CN/tutorial/102-installation.html) -- [Quick Start](https://modelscope.github.io/agentscope/zh_CN/tutorial/103-example.html) -- [Model](https://modelscope.github.io/agentscope/zh_CN/tutorial/203-model.html) -- [Prompt Engineering](https://modelscope.github.io/agentscope/zh_CN/tutorial/206-prompt.html) -- [Agent](https://modelscope.github.io/agentscope/zh_CN/tutorial/201-agent.html) -- [Memory](https://modelscope.github.io/agentscope/zh_CN/tutorial/205-memory.html) -- [Response Parser](https://modelscope.github.io/agentscope/zh_CN/tutorial/203-parser.html) -- [Tool](https://modelscope.github.io/agentscope/zh_CN/tutorial/204-service.html) -- [Pipeline and MsgHub](https://modelscope.github.io/agentscope/zh_CN/tutorial/202-pipeline.html) -- [Distribution](https://modelscope.github.io/agentscope/zh_CN/tutorial/208-distribute.html) -- [AgentScope Studio](https://modelscope.github.io/agentscope/zh_CN/tutorial/209-gui.html) -- [Logging](https://modelscope.github.io/agentscope/zh_CN/tutorial/105-logging.html) -- [Monitor](https://modelscope.github.io/agentscope/zh_CN/tutorial/207-monitor.html) -- [Example: Werewolf Game](https://modelscope.github.io/agentscope/zh_CN/tutorial/104-usecase.html) - ## License AgentScope is released under Apache License 2.0. diff --git a/README_JA.md b/README_JA.md index 8f5c26575..f951ca5be 100644 --- a/README_JA.md +++ b/README_JA.md @@ -63,7 +63,7 @@ LLMを活用したマルチエージェントアプリケーションをより AgentScopeは、開発者が大規模モデルを使用してマルチエージェントアプリケーションを構築する能力を提供する革新的なマルチエージェントプラットフォームです。 それは3つの高レベルの機能を備えています: -- 🤝 **使いやすさ**:開発者向けに設計されており、[豊富なコンポーネント](https://modelscope.github.io/agentscope/en/tutorial/204-service.html#)、[包括的なドキュメント](https://modelscope.github.io/agentscope/en/index.html)、および広範な互換性を提供します。さらに、[AgentScope Workstation](https://agentscope.io/)は、初心者向けの*ドラッグアンドドロッププログラミングプラットフォーム*と*copilot*を提供します。 +- 🤝 **使いやすさ**:開発者向けに設計されており、[豊富なコンポーネント](https://doc.agentscope.io/build_tutorial/tool.html#)、[包括的なドキュメント](https://doc.agentscope.io/index.html)、および広範な互換性を提供します。さらに、[AgentScope Workstation](https://agentscope.io/)は、初心者向けの*ドラッグアンドドロッププログラミングプラットフォーム*と*copilot*を提供します。 - ✅ **高い堅牢性**:カスタマイズ可能なフォールトトレランス制御と再試行メカニズムをサポートし、アプリケーションの安定性を向上させます。 @@ -73,26 +73,26 @@ AgentScopeは、開発者が大規模モデルを使用してマルチエージ AgentScopeは、ローカルモデルサービスとサードパーティのモデルAPIの両方をサポートするための`ModelWrapper`のリストを提供します。 -| API | タスク | モデルラッパー | 構成 | サポートされているモデルの一部 | -|------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| -| OpenAI API | チャット | [`OpenAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_chat_template.json) | gpt-4o, gpt-4, gpt-3.5-turbo, ... | -| | 埋め込み | [`OpenAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_embedding_template.json) | text-embedding-ada-002, ... | -| | DALL·E | [`OpenAIDALLEWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_dall_e_template.json) | dall-e-2, dall-e-3 | -| DashScope API | チャット | [`DashScopeChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_chat_template.json) | qwen-plus, qwen-max, ... | -| | 画像生成 | [`DashScopeImageSynthesisWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_image_synthesis_template.json) | wanx-v1 | -| | テキスト埋め込み | [`DashScopeTextEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_text_embedding_template.json) | text-embedding-v1, text-embedding-v2, ... | -| | マルチモーダル | [`DashScopeMultiModalWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_multimodal_template.json) | qwen-vl-max, qwen-vl-chat-v1, qwen-audio-chat | -| Gemini API | チャット | [`GeminiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#gemini-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_chat_template.json) | gemini-pro, ... | -| | 埋め込み | [`GeminiEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#gemini-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_embedding_template.json) | models/embedding-001, ... | -| ZhipuAI API | チャット | [`ZhipuAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#zhipu-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_chat_template.json) | glm-4, ... | -| | 埋め込み | [`ZhipuAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#zhipu-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_embedding_template.json) | embedding-2, ... | -| ollama | チャット | [`OllamaChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_chat_template.json) | llama3, llama2, Mistral, ... | -| | 埋め込み | [`OllamaEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_embedding_template.json) | llama2, Mistral, ... | -| | 生成 | [`OllamaGenerationWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_generate_template.json) | llama2, Mistral, ... | -| LiteLLM API | チャット | [`LiteLLMChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/litellm_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#litellm-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/litellm_chat_template.json) | [litellmがサポートするモデル](https://docs.litellm.ai/docs/)... | -| Yi API | チャット | [`YiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/yi_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/yi_chat_template.json) | yi-large, yi-medium, ... | -| Post Request based API | - | [`PostAPIModelWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/post_model.py) | [ガイダンス](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#post-request-api)
[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/postapi_model_config_template.json) | - | -| Anthropic API | Chat | [`AnthropicChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/anthropic_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#anthropic-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/anthropic_chat_model_config_template.json) | claude-3-5-sonnet-20241022, ... | +| API | タスク | モデルラッパー | 構成 | サポートされているモデルの一部 | +|------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| +| OpenAI API | チャット | [`OpenAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_chat_template.json) | gpt-4o, gpt-4, gpt-3.5-turbo, ... | +| | 埋め込み | [`OpenAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_embedding_template.json) | text-embedding-ada-002, ... | +| | DALL·E | [`OpenAIDALLEWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_dall_e_template.json) | dall-e-2, dall-e-3 | +| DashScope API | チャット | [`DashScopeChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_chat_template.json) | qwen-plus, qwen-max, ... | +| | 画像生成 | [`DashScopeImageSynthesisWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_image_synthesis_template.json) | wanx-v1 | +| | テキスト埋め込み | [`DashScopeTextEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_text_embedding_template.json) | text-embedding-v1, text-embedding-v2, ... | +| | マルチモーダル | [`DashScopeMultiModalWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_multimodal_template.json) | qwen-vl-max, qwen-vl-chat-v1, qwen-audio-chat | +| Gemini API | チャット | [`GeminiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_chat_template.json) | gemini-pro, ... | +| | 埋め込み | [`GeminiEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_embedding_template.json) | models/embedding-001, ... | +| ZhipuAI API | チャット | [`ZhipuAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_chat_template.json) | glm-4, ... | +| | 埋め込み | [`ZhipuAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_embedding_template.json) | embedding-2, ... | +| ollama | チャット | [`OllamaChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) |[テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_chat_template.json) | llama3, llama2, Mistral, ... | +| | 埋め込み | [`OllamaEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_embedding_template.json) | llama2, Mistral, ... | +| | 生成 | [`OllamaGenerationWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_generate_template.json) | llama2, Mistral, ... | +| LiteLLM API | チャット | [`LiteLLMChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/litellm_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/litellm_chat_template.json) | [litellmがサポートするモデル](https://docs.litellm.ai/docs/)... | +| Yi API | チャット | [`YiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/yi_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/yi_chat_template.json) | yi-large, yi-medium, ... | +| Post Request based API | - | [`PostAPIModelWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/post_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/postapi_model_config_template.json) | - | +| Anthropic API | Chat | [`AnthropicChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/anthropic_model.py) | [テンプレート](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/anthropic_chat_model_config_template.json) | claude-3-5-sonnet-20241022, ... | **サポートされているローカルモデルのデプロイ** @@ -179,7 +179,7 @@ pip install agentscope ### 追加の依存関係 -さまざまなデプロイメントシナリオをサポートするために、AgentScopeはいくつかのオプションの依存関係を提供します。オプションの依存関係の完全なリストは、[チュートリアル](https://doc.agentscope.io/en/tutorial/102-installation.html)を参照してください。分散モードを例にとると、次のように依存関係をインストールできます: +さまざまなデプロイメントシナリオをサポートするために、AgentScopeはいくつかのオプションの依存関係を提供します。オプションの依存関係の完全なリストは、[チュートリアル](https://doc.agentscope.io/build_tutorial/quickstart.html)を参照してください。分散モードを例にとると、次のように依存関係をインストールできます: #### Windowsの場合 @@ -277,30 +277,12 @@ while True: AgentScopeは、テキスト、画像、オーディオ、ビデオなどのマルチモーダル出力をフロントエンドで表示できる使いやすいランタイムユーザーインターフェースを提供します。 -詳細については、[チュートリアル](https://modelscope.github.io/agentscope/en/tutorial/209-gui.html)を参照してください。 +詳細については、[チュートリアル](https://doc.agentscope.io/build_tutorial/visual.html)を参照してください。
agentscope-logo
-## チュートリアル - -- [AgentScopeについて](https://modelscope.github.io/agentscope/zh_CN/tutorial/101-agentscope.html) -- [インストール](https://modelscope.github.io/agentscope/zh_CN/tutorial/102-installation.html) -- [クイックスタート](https://modelscope.github.io/agentscope/zh_CN/tutorial/103-example.html) -- [モデル](https://modelscope.github.io/agentscope/zh_CN/tutorial/203-model.html) -- [プロンプトエンジニアリング](https://modelscope.github.io/agentscope/zh_CN/tutorial/206-prompt.html) -- [エージェント](https://modelscope.github.io/agentscope/zh_CN/tutorial/201-agent.html) -- [メモリ](https://modelscope.github.io/agentscope/zh_CN/tutorial/205-memory.html) -- [応答パーサー](https://modelscope.github.io/agentscope/zh_CN/tutorial/203-parser.html) -- [ツール](https://modelscope.github.io/agentscope/zh_CN/tutorial/204-service.html) -- [パイプラインとMsgHub](https://modelscope.github.io/agentscope/zh_CN/tutorial/202-pipeline.html) -- [分散](https://modelscope.github.io/agentscope/zh_CN/tutorial/208-distribute.html) -- [AgentScope Studio](https://modelscope.github.io/agentscope/zh_CN/tutorial/209-gui.html) -- [ログ](https://modelscope.github.io/agentscope/zh_CN/tutorial/105-logging.html) -- [モニター](https://modelscope.github.io/agentscope/zh_CN/tutorial/207-monitor.html) -- [例:人狼ゲーム](https://modelscope.github.io/agentscope/zh_CN/tutorial/104-usecase.html) - ## ライセンス AgentScopeはApache License 2.0の下でリリースされています。 diff --git a/README_ZH.md b/README_ZH.md index 54e57196f..ff0a5c9de 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -62,7 +62,7 @@ AgentScope是一个创新的多智能体开发平台,旨在赋予开发人员使用大模型轻松构建多智能体应用的能力。 -- 🤝 **高易用**: AgentScope专为开发人员设计,提供了[丰富的组件](https://modelscope.github.io/agentscope/en/tutorial/204-service.html#), [全面的文档](https://modelscope.github.io/agentscope/zh_CN/index.html)和广泛的兼容性。同时,[AgentScope Workstation](https://agentscope.io/)提供了在线拖拉拽编程和在线小助手(copilot)功能,帮助开发者迅速上手! +- 🤝 **高易用**: AgentScope专为开发人员设计,提供了[丰富的组件](https://doc.agentscope.io/build_tutorial/tool.html#), [全面的文档](https://doc.agentscope.io/index.html)和广泛的兼容性。同时,[AgentScope Workstation](https://agentscope.io/)提供了在线拖拉拽编程和在线小助手(copilot)功能,帮助开发者迅速上手! - ✅ **高鲁棒**:支持自定义的容错控制和重试机制,以提高应用程序的稳定性。 @@ -72,26 +72,26 @@ AgentScope是一个创新的多智能体开发平台,旨在赋予开发人员 AgentScope提供了一系列`ModelWrapper`来支持本地模型服务和第三方模型API。 -| API | Task | Model Wrapper | Configuration | Some Supported Models | -|------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------| -| OpenAI API | Chat | [`OpenAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_chat_template.json) | gpt-4o, gpt-4, gpt-3.5-turbo, ... | -| | Embedding | [`OpenAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_embedding_template.json) | text-embedding-ada-002, ... | -| | DALL·E | [`OpenAIDALLEWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#openai-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_dall_e_template.json) | dall-e-2, dall-e-3 | -| DashScope API | Chat | [`DashScopeChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_chat_template.json) | qwen-plus, qwen-max, ... | -| | Image Synthesis | [`DashScopeImageSynthesisWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_image_synthesis_template.json) | wanx-v1 | -| | Text Embedding | [`DashScopeTextEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_text_embedding_template.json) | text-embedding-v1, text-embedding-v2, ... | -| | Multimodal | [`DashScopeMultiModalWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#dashscope-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_multimodal_template.json) | qwen-vl-max, qwen-vl-chat-v1, qwen-audio-chat | -| Gemini API | Chat | [`GeminiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#gemini-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_chat_template.json) | gemini-pro, ... | -| | Embedding | [`GeminiEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#gemini-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_embedding_template.json) | models/embedding-001, ... | -| ZhipuAI API | Chat | [`ZhipuAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#zhipu-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_chat_template.json) | glm-4, ... | -| | Embedding | [`ZhipuAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#zhipu-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_embedding_template.json) | embedding-2, ... | -| ollama | Chat | [`OllamaChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_chat_template.json) | llama3, llama2, Mistral, ... | -| | Embedding | [`OllamaEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_embedding_template.json) | llama2, Mistral, ... | -| | Generation | [`OllamaGenerationWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#ollama-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_generate_template.json) | llama2, Mistral, ... | -| LiteLLM API | Chat | [`LiteLLMChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/litellm_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#litellm-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/litellm_chat_template.json) | [models supported by litellm](https://docs.litellm.ai/docs/)... | -| Yi API | Chat | [`YiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/yi_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/yi_chat_template.json) | yi-large, yi-medium, ... | -| Post Request based API | - | [`PostAPIModelWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/post_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#post-request-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/postapi_model_config_template.json) | - | -| Anthropic API | Chat | [`AnthropicChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/anthropic_model.py) | [guidance](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#anthropic-api)
[template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/anthropic_chat_model_config_template.json) | claude-3-5-sonnet-20241022, ... | +| API | Task | Model Wrapper | Configuration | Some Supported Models | +|------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------| +| OpenAI API | Chat | [`OpenAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_chat_template.json) | gpt-4o, gpt-4, gpt-3.5-turbo, ... | +| | Embedding | [`OpenAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_embedding_template.json) | text-embedding-ada-002, ... | +| | DALL·E | [`OpenAIDALLEWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/openai_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/openai_dall_e_template.json) | dall-e-2, dall-e-3 | +| DashScope API | Chat | [`DashScopeChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_chat_template.json) | qwen-plus, qwen-max, ... | +| | Image Synthesis | [`DashScopeImageSynthesisWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_image_synthesis_template.json) | wanx-v1 | +| | Text Embedding | [`DashScopeTextEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_text_embedding_template.json) | text-embedding-v1, text-embedding-v2, ... | +| | Multimodal | [`DashScopeMultiModalWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/dashscope_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/dashscope_multimodal_template.json) | qwen-vl-max, qwen-vl-chat-v1, qwen-audio-chat | +| Gemini API | Chat | [`GeminiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_chat_template.json) | gemini-pro, ... | +| | Embedding | [`GeminiEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/gemini_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/gemini_embedding_template.json) | models/embedding-001, ... | +| ZhipuAI API | Chat | [`ZhipuAIChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_chat_template.json) | glm-4, ... | +| | Embedding | [`ZhipuAIEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/zhipu_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/zhipu_embedding_template.json) | embedding-2, ... | +| ollama | Chat | [`OllamaChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_chat_template.json) | llama3, llama2, Mistral, ... | +| | Embedding | [`OllamaEmbeddingWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_embedding_template.json) | llama2, Mistral, ... | +| | Generation | [`OllamaGenerationWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/ollama_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/ollama_generate_template.json) | llama2, Mistral, ... | +| LiteLLM API | Chat | [`LiteLLMChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/litellm_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/litellm_chat_template.json) | [models supported by litellm](https://docs.litellm.ai/docs/)... | +| Yi API | Chat | [`YiChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/yi_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/yi_chat_template.json) | yi-large, yi-medium, ... | +| Post Request based API | - | [`PostAPIModelWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/post_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/postapi_model_config_template.json) | - | +| Anthropic API | Chat | [`AnthropicChatWrapper`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/models/anthropic_model.py) | [template](https://github.com/modelscope/agentscope/blob/main/examples/model_configs_template/anthropic_chat_model_config_template.json) | claude-3-5-sonnet-20241022, ... | **支持的本地模型部署** AgentScope支持使用以下库快速部署本地模型服务。 @@ -177,7 +177,7 @@ pip install agentscope ### 额外依赖 为了支持不同的部署场景,AgentScope提供了若干个可选的依赖项。 -完整的可选依赖项列表请参考[tutorial](https://doc.agentscope.io/en/tutorial/102-installation.html) +完整的可选依赖项列表请参考[tutorial](https://doc.agentscope.io/build_tutorial/quickstart.html) 以分布式模式为例,可以使用以下命令安装AgentScope: #### On Windows @@ -276,30 +276,12 @@ while True: AgentScope 提供了一个易于使用的运行时用户界面,能够在前端显示多模态输出,包括文本、图像、音频和视频。 -参考我们的[教程](https://modelscope.github.io/agentscope/zh_CN/tutorial/209-gui.html)了解更多细节。 +参考我们的[教程](https://doc.agentscope.io/build_tutorial/visual.html)了解更多细节。
agentscope-logo
-## 教程 - -- [关于AgentScope](https://modelscope.github.io/agentscope/zh_CN/tutorial/101-agentscope.html) -- [安装](https://modelscope.github.io/agentscope/zh_CN/tutorial/102-installation.html) -- [快速开始](https://modelscope.github.io/agentscope/zh_CN/tutorial/103-example.html) -- [模型](https://modelscope.github.io/agentscope/zh_CN/tutorial/203-model.html) -- [提示工程](https://modelscope.github.io/agentscope/zh_CN/tutorial/206-prompt.html) -- [Agent](https://modelscope.github.io/agentscope/zh_CN/tutorial/201-agent.html) -- [记忆](https://modelscope.github.io/agentscope/zh_CN/tutorial/205-memory.html) -- [结果解析](https://modelscope.github.io/agentscope/zh_CN/tutorial/203-parser.html) -- [工具](https://modelscope.github.io/agentscope/zh_CN/tutorial/204-service.html) -- [Pipeline和MsgHub](https://modelscope.github.io/agentscope/zh_CN/tutorial/202-pipeline.html) -- [分布式](https://modelscope.github.io/agentscope/zh_CN/tutorial/208-distribute.html) -- [AgentScope Studio](https://modelscope.github.io/agentscope/zh_CN/tutorial/209-gui.html) -- [日志](https://modelscope.github.io/agentscope/zh_CN/tutorial/105-logging.html) -- [监控器](https://modelscope.github.io/agentscope/zh_CN/tutorial/207-monitor.html) -- [样例:狼人杀游戏](https://modelscope.github.io/agentscope/zh_CN/tutorial/104-usecase.html) - ## License AgentScope根据Apache License 2.0发布。 diff --git a/docs/news_en.md b/docs/news_en.md index 78eafc42f..f5eac5f4f 100644 --- a/docs/news_en.md +++ b/docs/news_en.md @@ -1,7 +1,7 @@ # News -- **[2024-07-18]** AgentScope supports streaming mode now! Refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/203-stream.html) and example [conversation in stream mode](https://github.com/modelscope/agentscope/tree/main/examples/conversation_in_stream_mode) for more details. +- **[2024-07-18]** AgentScope supports streaming mode now! Refer to our [tutorial](https://doc.agentscope.io/build_tutorial/streaming.html) and example [conversation in stream mode](https://github.com/modelscope/agentscope/tree/main/examples/conversation_in_stream_mode) for more details.
agentscope-logo @@ -10,14 +10,14 @@ - **[2024-07-15]** AgentScope has implemented the Mixture-of-Agents algorithm. Refer to our [MoA example](https://github.com/modelscope/agentscope/blob/main/examples/conversation_mixture_of_agents) for more details. -- **[2024-06-14]** A new prompt tuning module is available in AgentScope to help developers generate and optimize the agents' system prompts! Refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/209-prompt_opt.html) for more details! +- **[2024-06-14]** A new prompt tuning module is available in AgentScope to help developers generate and optimize the agents' system prompts! Refer to our [tutorial](https://doc.agentscope.io/build_tutorial/prompt_optimization.html) for more details! -- **[2024-06-11]** The RAG functionality is available for agents in **AgentScope** now! [**A quick introduction to RAG in AgentScope**](https://modelscope.github.io/agentscope/en/tutorial/210-rag.html) can help you equip your agent with external knowledge! +- **[2024-06-11]** The RAG functionality is available for agents in **AgentScope** now! [**A quick introduction to RAG in AgentScope**](https://doc.agentscope.io/tutorial/rag.html) can help you equip your agent with external knowledge! -- **[2024-06-09]** We release **AgentScope** v0.0.5 now! In this new version, [**AgentScope Workstation**](https://modelscope.github.io/agentscope/en/tutorial/209-gui.html) (the online version is running on [agentscope.io](https://agentscope.io)) is open-sourced with the refactored [**AgentScope Studio**](https://modelscope.github.io/agentscope/en/tutorial/209-gui.html)! +- **[2024-06-09]** We release **AgentScope** v0.0.5 now! In this new version, [**AgentScope Workstation**](https://doc.agentscope.io/build_tutorial/visual.html) (the online version is running on [agentscope.io](https://agentscope.io)) is open-sourced with the refactored [**AgentScope Studio**](https://doc.agentscope.io/build_tutorial/visual.html)! - **[2024-05-24]** We are pleased to announce that features related to the **AgentScope Workstation** will soon be open-sourced! The online website services are temporarily offline. The online website service will be upgraded and back online shortly. Stay tuned... -- **[2024-05-15]** A new **Parser Module** for **formatted response** is added in AgentScope! Refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/203-parser.html) for more details. The [`DictDialogAgent`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/agents/dict_dialog_agent.py) and [werewolf game](https://github.com/modelscope/agentscope/tree/main/examples/game_werewolf) example are updated simultaneously. +- **[2024-05-15]** A new **Parser Module** for **formatted response** is added in AgentScope! Refer to our [tutorial](https://doc.agentscope.io/build_tutorial/structured_output.html) for more details. The [`DictDialogAgent`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/agents/dict_dialog_agent.py) and [werewolf game](https://github.com/modelscope/agentscope/tree/main/examples/game_werewolf) example are updated simultaneously. @@ -36,7 +36,7 @@ - **[2024-04-06]** New examples [Gomoku](https://github.com/modelscope/agentscope/blob/main/examples/game_gomoku), [Conversation with ReAct Agent](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_react_agent), [Conversation with RAG Agent](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_RAG_agents) and [Distributed Parallel Optimization](https://github.com/modelscope/agentscope/blob/main/examples/distributed_parallel_optimization) are available now! - **[2024-03-19]** We release **AgentScope** v0.0.2 now! In this new version, -AgentScope supports [ollama](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)(A local CPU inference engine), [DashScope](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models) and Google [Gemini](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models) APIs. +AgentScope supports ollama(A local CPU inference engine), DashScope and Google Gemini APIs. - **[2024-03-19]** New examples ["Autonomous Conversation with Mentions"](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_mentions) and ["Basic Conversation with LangChain library"](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_langchain) are available now! diff --git a/docs/news_ja.md b/docs/news_ja.md index 0292de5ad..dfc8fd24b 100644 --- a/docs/news_ja.md +++ b/docs/news_ja.md @@ -1,6 +1,6 @@ # News -- **[2024-07-18]** AgentScopeはストリーミングモードをサポートしています。詳細については、[チュートリアル](https://modelscope.github.io/agentscope/en/tutorial/203-stream.html)および[ストリーミングモードでの会話の例](https://github.com/modelscope/agentscope/tree/main/examples/conversation_in_stream_mode)を参照してください。 +- **[2024-07-18]** AgentScopeはストリーミングモードをサポートしています。詳細については、[チュートリアル](https://doc.agentscope.io/build_tutorial/streaming.html)および[ストリーミングモードでの会話の例](https://github.com/modelscope/agentscope/tree/main/examples/conversation_in_stream_mode)を参照してください。
agentscope-logo @@ -9,18 +9,18 @@ - **[2024-07-15]** AgentScopeはMixture-of-Agentsアルゴリズムを実装しました。詳細については、[MoAの例](https://github.com/modelscope/agentscope/blob/main/examples/conversation_mixture_of_agents)を参照してください。 -- **[2024-06-14]** 新しいプロンプトチューニングモジュールがAgentScopeに追加され、開発者がエージェントのシステムプロンプトを生成および最適化するのに役立ちます。詳細については、[チュートリアル](https://modelscope.github.io/agentscope/en/tutorial/209-prompt_opt.html)を参照してください。 +- **[2024-06-14]** 新しいプロンプトチューニングモジュールがAgentScopeに追加され、開発者がエージェントのシステムプロンプトを生成および最適化するのに役立ちます。詳細については、[チュートリアル](https://doc.agentscope.io/build_tutorial/prompt_optimization.html)を参照してください。 -- **[2024-06-11]** RAG機能が**AgentScope**に追加されました。エージェントに外部知識を装備するための[**AgentScopeのRAGの簡単な紹介**](https://modelscope.github.io/agentscope/en/tutorial/210-rag.html)を参照してください。 +- **[2024-06-11]** RAG機能が**AgentScope**に追加されました。エージェントに外部知識を装備するための[**AgentScopeのRAGの簡単な紹介**](https://doc.agentscope.io/tutorial/rag.html)を参照してください。 -- **[2024-06-09]** **AgentScope** v0.0.5がリリースされました。この新しいバージョンでは、[**AgentScope Workstation**](https://modelscope.github.io/agentscope/en/tutorial/209-gui.html)(オンラインバージョンは[agentscope.io](https://agentscope.io)で実行されています)がリファクタリングされた[**AgentScope Studio**](https://modelscope.github.io/agentscope/en/tutorial/209-gui.html)とともにオープンソース化されました。 +- **[2024-06-09]** **AgentScope** v0.0.5がリリースされました。この新しいバージョンでは、[**AgentScope Workstation**](https://doc.agentscope.io/build_tutorial/visual.html)(オンラインバージョンは[agentscope.io](https://agentscope.io)で実行されています)がリファクタリングされた[**AgentScope Studio**](https://doc.agentscope.io/build_tutorial/visual.html)とともにオープンソース化されました。
完全なニュース - **[2024-05-24]** **AgentScope Workstation**に関連する機能がまもなくオープンソース化されることをお知らせします。オンラインウェブサイトサービスは一時的にオフラインになっています。オンラインウェブサイトサービスはアップグレードされ、まもなく再開されます。お楽しみに... -- **[2024-05-15]** **フォーマットされた応答**のための新しい**パーサーモジュール**がAgentScopeに追加されました。詳細については、[チュートリアル](https://modelscope.github.io/agentscope/en/tutorial/203-parser.html)を参照してください。[`DictDialogAgent`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/agents/dict_dialog_agent.py)および[人狼ゲーム](https://github.com/modelscope/agentscope/tree/main/examples/game_werewolf)の例も同時に更新されました。 +- **[2024-05-15]** **フォーマットされた応答**のための新しい**パーサーモジュール**がAgentScopeに追加されました。詳細については、[チュートリアル](https://doc.agentscope.io/build_tutorial/structured_output.html)を参照してください。[`DictDialogAgent`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/agents/dict_dialog_agent.py)および[人狼ゲーム](https://github.com/modelscope/agentscope/tree/main/examples/game_werewolf)の例も同時に更新されました。 - **[2024-05-14]** 親愛なるAgentScopeユーザーの皆様、**AgentScope Workstation & Copilot**のユーザーエクスペリエンスに関するアンケートを実施しています。現在、AgentScopeのドラッグアンドドロップマルチエージェントアプリケーション開発とCopilotのエクスペリエンスを改善するために、貴重なフィードバックが必要です。フィードバックは貴重であり、アンケートには約3〜5分かかります。アンケート調査に参加するには、[URL](https://survey.aliyun.com/apps/zhiliao/vgpTppn22)をクリックしてください。ご支援とご協力に感謝します。 @@ -36,7 +36,7 @@ - **[2024-04-06]** 新しい例[五目並べ](https://github.com/modelscope/agentscope/blob/main/examples/game_gomoku)、[ReActエージェントとの会話](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_react_agent)、[RAGエージェントとの会話](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_RAG_agents)、および[分散並列最適化](https://github.com/modelscope/agentscope/blob/main/examples/distributed_parallel_optimization)が利用可能になりました。 -- **[2024-03-19]** **AgentScope** v0.0.2がリリースされました。この新しいバージョンでは、AgentScopeは[ollama](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)(ローカルCPU推論エンジン)、[DashScope](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)およびGoogle[Gemini](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)APIをサポートしています。 +- **[2024-03-19]** **AgentScope** v0.0.2がリリースされました。この新しいバージョンでは、AgentScopeはollama(ローカルCPU推論エンジン)、DashScopeおよびGoogle Gemini APIをサポートしています。 - **[2024-03-19]** 新しい例「[メンション付きの自律会話](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_mentions)」および「[LangChainライブラリを使用した基本的な会話](https://github.com/modelscope/agentscope/blob/main/examples/conversation_with_langchain)」が利用可能になりました。 diff --git a/docs/news_zh.md b/docs/news_zh.md index c75ea98e7..4acdbba58 100644 --- a/docs/news_zh.md +++ b/docs/news_zh.md @@ -1,6 +1,6 @@ # News -- **[2024-07-18]** AgentScope 已支持模型流式输出。请参考我们的 [**教程**](https://modelscope.github.io/agentscope/zh_CN/tutorial/203-stream.html) 和 [**流式对话样例**](https://github.com/modelscope/agentscope/tree/main/examples/conversation_in_stream_mode)! +- **[2024-07-18]** AgentScope 已支持模型流式输出。请参考我们的 [**教程**](https://doc.agentscope.io/build_tutorial/streaming.html) 和 [**流式对话样例**](https://github.com/modelscope/agentscope/tree/main/examples/conversation_in_stream_mode)!
agentscope-logo @@ -9,18 +9,18 @@ - **[2024-07-15]** AgentScope 中添加了 Mixture of Agents 算法。使用样例请参考 [MoA 示例](https://github.com/modelscope/agentscope/blob/main/examples/conversation_mixture_of_agents)。 -- **[2024-06-14]** 新的提示调优(Prompt tuning)模块已经上线 AgentScope,用以帮助开发者生成和优化智能体的 system prompt。更多的细节和使用样例请参考 AgentScope [教程](https://modelscope.github.io/agentscope/en/tutorial/209-prompt_opt.html)! +- **[2024-06-14]** 新的提示调优(Prompt tuning)模块已经上线 AgentScope,用以帮助开发者生成和优化智能体的 system prompt。更多的细节和使用样例请参考 AgentScope [教程](https://doc.agentscope.io/build_tutorial/prompt_optimization.html)! -- **[2024-06-11]** RAG功能现在已经整合进 **AgentScope** 中! 大家可以根据 [**简要介绍AgentScope中的RAG**](https://modelscope.github.io/agentscope/en/tutorial/210-rag.html) ,让自己的agent用上外部知识! +- **[2024-06-11]** RAG功能现在已经整合进 **AgentScope** 中! 大家可以根据 [**简要介绍AgentScope中的RAG**](https://doc.agentscope.io/tutorial/rag.html) ,让自己的agent用上外部知识! -- **[2024-06-09]** AgentScope v0.0.5 已经更新!在这个新版本中,我们开源了 [**AgentScope Workstation**](https://modelscope.github.io/agentscope/en/tutorial/209-gui.html) (在线版本的网址是[agentscope.io](https://agentscope.io))! +- **[2024-06-09]** AgentScope v0.0.5 已经更新!在这个新版本中,我们开源了 [**AgentScope Workstation**](https://doc.agentscope.io/build_tutorial/visual.html) (在线版本的网址是[agentscope.io](https://agentscope.io))!
完整新闻 - **[2024-05-24]** 我们很高兴地宣布 **AgentScope Workstation** 相关功能即将开源。我们的网站服务暂时下线。在线服务会很快升级重新上线,敬请期待... -- **[2024-05-15]** 用于解析模型格式化输出的**解析器**模块已经上线 AgentScope!更轻松的构建多智能体应用,使用方法请参考[教程](https://modelscope.github.io/agentscope/en/tutorial/203-parser.html)。与此同时,[`DictDialogAgent`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/agents/dict_dialog_agent.py) 类和 [狼人杀游戏](https://github.com/modelscope/agentscope/tree/main/examples/game_werewolf) 样例也已经同步更新! +- **[2024-05-15]** 用于解析模型格式化输出的**解析器**模块已经上线 AgentScope!更轻松的构建多智能体应用,使用方法请参考[教程](https://doc.agentscope.io/build_tutorial/structured_output.html)。与此同时,[`DictDialogAgent`](https://github.com/modelscope/agentscope/blob/main/src/agentscope/agents/dict_dialog_agent.py) 类和 [狼人杀游戏](https://github.com/modelscope/agentscope/tree/main/examples/game_werewolf) 样例也已经同步更新! - **[2024-05-14]** 目前 AgentScope 正在进行 AgentScope Workstation & Copilot 用户体验反馈活动,需要您宝贵的意见来帮助我们改善 AgentScope 的拖拽式多智能体应用开发与 Copilot 体验。您的每一个反馈都十分宝贵,请点击 [链接](https://survey.aliyun.com/apps/zhiliao/vgpTppn22) 参与问卷,感谢您的支持! @@ -36,7 +36,7 @@ - **[2024-04-06]** 新的样例“[五子棋](./examples/game_gomoku)”,“[与ReAct智能体对话](./examples/conversation_with_react_agent)”,“[与RAG智能体对话](./examples/conversation_with_RAG_agents)”,“[分布式并行优化](./examples/distributed_parallel_optimization)”上线了! -- **[2024-03-19]** 我们现在发布了**AgentScope** v0.0.2版本!在这个新版本中,AgentScope支持了[ollama](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)(本地CPU推理引擎),[DashScope](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models)和[Gemini](https://modelscope.github.io/agentscope/en/tutorial/203-model.html#supported-models) APIs。 +- **[2024-03-19]** 我们现在发布了**AgentScope** v0.0.2版本!在这个新版本中,AgentScope支持了ollama(本地CPU推理引擎),DashScope和Gemini APIs。 - **[2024-03-19]** 新的样例“[带有@功能的自主对话](./examples/conversation_with_mentions)”和“[兼容LangChain的基础对话](./examples/conversation_with_langchain)”上线了! diff --git a/examples/conversation_in_stream_mode/README.md b/examples/conversation_in_stream_mode/README.md index d24415dee..7f39e5e69 100644 --- a/examples/conversation_in_stream_mode/README.md +++ b/examples/conversation_in_stream_mode/README.md @@ -4,7 +4,7 @@ In this example, we will show - How to set up the stream mode in AgentScope - How to print in stream mode in both terminal and AgentScope Studio -Refer to our tutorial for more information: [Streaming](https://modelscope.github.io/agentscope/en/tutorial/203-stream.html). +Refer to our tutorial for more information: [Streaming](https://doc.agentscope.io/build_tutorial/streaming.html). ## Tested Models diff --git a/examples/conversation_nl2sql/react_nl2sql.ipynb b/examples/conversation_nl2sql/react_nl2sql.ipynb index fbaf29a44..74eaff838 100644 --- a/examples/conversation_nl2sql/react_nl2sql.ipynb +++ b/examples/conversation_nl2sql/react_nl2sql.ipynb @@ -20,7 +20,7 @@ "\n", "- Follow [READMD.md](https://github.com/modelscope/agentscope) to install AgentScope.\n", "- Install the third-party libraries used in [DAIL-SQL](https://github.com/BeachWang/DAIL-SQL/blob/main/requirements.txt).\n", - "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/203-model.html).\n", + "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://doc.agentscope.io/build_tutorial/model.html).\n", "- Get familiar with service functions, ServiceToolkit module and build-in ReAct agent. The corresponding example can be found in [ReAct agent example](../conversation_with_react_agent/main.ipynb).\n", "\n", "## Note\n", diff --git a/examples/conversation_with_codeact_agent/codeact_agent_example_modeling.ipynb b/examples/conversation_with_codeact_agent/codeact_agent_example_modeling.ipynb index f7b80eba2..324ec9c70 100644 --- a/examples/conversation_with_codeact_agent/codeact_agent_example_modeling.ipynb +++ b/examples/conversation_with_codeact_agent/codeact_agent_example_modeling.ipynb @@ -12,7 +12,7 @@ "## Prerequisites\n", "\n", "- Follow [READMD.md](https://github.com/modelscope/agentscope) to install AgentScope. We require the lastest version, so you should build from source by running `pip install -e .` instead of intalling from pypi. \n", - "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/203-model.html).\n", + "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://doc.agentscope.io/build_tutorial/model.html).\n", "\n", "## Note\n", "- The example is tested with the following models. For other models, you may need to adjust the prompt.\n", diff --git a/examples/conversation_with_codeact_agent/codeact_agent_example_tools.ipynb b/examples/conversation_with_codeact_agent/codeact_agent_example_tools.ipynb index 787e1a15f..5a1b4ff73 100644 --- a/examples/conversation_with_codeact_agent/codeact_agent_example_tools.ipynb +++ b/examples/conversation_with_codeact_agent/codeact_agent_example_tools.ipynb @@ -15,7 +15,7 @@ "## Prerequisites\n", "\n", "- Follow [READMD.md](https://github.com/modelscope/agentscope) to install AgentScope. We require the lastest version, so you should build from source by running `pip install -e .` instead of intalling from pypi. \n", - "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/203-model.html).\n", + "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://doc.agentscope.io/build_tutorial/model.html).\n", "\n", "## Note\n", "- The example is tested with the following models. For other models, you may need to adjust the prompt.\n", diff --git a/examples/conversation_with_customized_services/main.ipynb b/examples/conversation_with_customized_services/main.ipynb index b9e4e4aa5..61cf2e4ab 100644 --- a/examples/conversation_with_customized_services/main.ipynb +++ b/examples/conversation_with_customized_services/main.ipynb @@ -24,7 +24,7 @@ "\n", "## Background\n", "\n", - "AgentScope has built in service toolkit module ([tutorial](https://modelscope.github.io/agentscope/en/tutorial/204-service.html#how-to-use-service-functions), [source code](https://github.com/modelscope/agentscope/blob/cccecb23f56591d859403f86ff0360a5cb4dda1c/src/agentscope/service/service_toolkit.py)) for tools usage, helping developers to integrate service functions into their agents. It provides: \n", + "AgentScope has built in service toolkit module ([tutorial](https://doc.agentscope.io/build_tutorial/tool.html), [source code](https://github.com/modelscope/agentscope/blob/cccecb23f56591d859403f86ff0360a5cb4dda1c/src/agentscope/service/service_toolkit.py)) for tools usage, helping developers to integrate service functions into their agents. It provides: \n", "- format instruction for LLMs\n", "- automatic function description generation in JSON schema format\n", "- LLM response parsing \n", diff --git a/examples/conversation_with_react_agent/main.ipynb b/examples/conversation_with_react_agent/main.ipynb index f58726262..7d9ad451e 100644 --- a/examples/conversation_with_react_agent/main.ipynb +++ b/examples/conversation_with_react_agent/main.ipynb @@ -13,7 +13,7 @@ "## Prerequisites\n", "\n", "- Follow [READMD.md](https://github.com/modelscope/agentscope) to install AgentScope. \n", - "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/203-model.html).\n", + "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://doc.agentscope.io/build_tutorial/model.html).\n", "- [Optional] A bing (or google) search API key is suggested to experience the web search function. Here we take bing search as an example. \n", "\n", "## Note\n", diff --git a/examples/conversation_with_swe-agent/main.ipynb b/examples/conversation_with_swe-agent/main.ipynb index b4782f4a8..292552c5f 100644 --- a/examples/conversation_with_swe-agent/main.ipynb +++ b/examples/conversation_with_swe-agent/main.ipynb @@ -15,8 +15,8 @@ "## Prerequisites\n", "\n", "- Follow [READMD.md](https://github.com/modelscope/agentscope) to install AgentScope. We require the lastest version, so you should build from source by running `pip install -e .` instead of intalling from pypi. \n", - "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://modelscope.github.io/agentscope/en/tutorial/203-model.html).\n", - "- Understand the ServiceToolkit module and how to use it to pre-process the tool functions for LLMs. You can refer to the [ReAct agent example](../conversation_with_react_agent/main.ipynb) and you should also refer to the [tutorial](https://modelscope.github.io/agentscope/en/tutorial/204-service.html) for service functions.\n", + "- Prepare a model configuration. AgentScope supports both local deployed model services (CPU or GPU) and third-party services. More details and example model configurations please refer to our [tutorial](https://doc.agentscope.io/build_tutorial/model.html).\n", + "- Understand the ServiceToolkit module and how to use it to pre-process the tool functions for LLMs. You can refer to the [ReAct agent example](../conversation_with_react_agent/main.ipynb) and you should also refer to the [tutorial](https://doc.agentscope.io/build_tutorial/tool.html) for service functions.\n", "\n", "\n", "## Note\n", diff --git a/examples/game_werewolf/README.md b/examples/game_werewolf/README.md index 9c61ac11c..9d6194395 100644 --- a/examples/game_werewolf/README.md +++ b/examples/game_werewolf/README.md @@ -14,13 +14,13 @@ The werewolf game involves a complex SOP with multiple roles and different phase Therefore, for an agent in werewolf game, it should be able to switch its status according to the game phase and its role, and respond accordingly. Of course, we can hard code the SOP (or finite state machine) within the agent, but we expect the agent to be more **flexible**, **intelligent**, and **adaptive**, which means **the agent shouldn't be designed for a specific game only**. It should be able to adapt to different tasks and SOPs! -To achieve this goal, in AgentScope, we use a built-in [DictDialogAgent](https://github.com/modelscope/agentscope/blob/main/src/agentscope/agents/dict_dialog_agent.py) class, together with a [parser](https://modelscope.github.io/agentscope/en/tutorial/203-parser.html) module to construct the werewolf game. +To achieve this goal, in AgentScope, we use a built-in [DictDialogAgent](https://github.com/modelscope/agentscope/blob/main/src/agentscope/agents/dict_dialog_agent.py) class, together with a [parser](https://doc.agentscope.io/build_tutorial/structured_output.html) module to construct the werewolf game. -Moreover, the [pipeline and msghub](https://modelscope.github.io/agentscope/en/tutorial/202-pipeline.html) in AgentScope enable us to easily construct a complex SOP with multiple agents. We hope the implementation is concise, clear and readable! +Moreover, the [msghub](https://doc.agentscope.io/build_tutorial/conversation.html#more-than-two-agents) in AgentScope enable us to easily construct a complex SOP with multiple agents. We hope the implementation is concise, clear and readable! More details please refer to our tutorial: -- [Parser](https://modelscope.github.io/agentscope/en/tutorial/203-parser.html) -- [Pipeline and msghub](https://modelscope.github.io/agentscope/en/tutorial/202-pipeline.html) +- [Parser](https://doc.agentscope.io/build_tutorial/structured_output.html) +- [MsgHub](https://doc.agentscope.io/build_tutorial/conversation.html#more-than-two-agents) diff --git a/src/agentscope/agents/agent.py b/src/agentscope/agents/agent.py index 6cabace3d..e5af66945 100644 --- a/src/agentscope/agents/agent.py +++ b/src/agentscope/agents/agent.py @@ -150,7 +150,7 @@ def speak( Args: content - (`Union[str, Msg, Generator[Tuple[bool, str], None, None]]`): + (`Union[str, Msg, Generator[Tuple[bool, str], None, None]]`): The content of the message to be spoken out. If a string is given, a Msg object will be created with the agent's name, role as "assistant", and the given string as the content. diff --git a/src/agentscope/agents/dict_dialog_agent.py b/src/agentscope/agents/dict_dialog_agent.py index 60fcc9e36..894440838 100644 --- a/src/agentscope/agents/dict_dialog_agent.py +++ b/src/agentscope/agents/dict_dialog_agent.py @@ -12,7 +12,7 @@ class DictDialogAgent(AgentBase): specify the required fields in the response via specifying the parser About parser, please refer to our - [tutorial](https://modelscope.github.io/agentscope/en/tutorial/203-parser.html) + [tutorial](https://doc.agentscope.io/build_tutorial/structured_output.html) For usage example, please refer to the example of werewolf in `examples/game_werewolf`""" diff --git a/src/agentscope/models/dashscope_model.py b/src/agentscope/models/dashscope_model.py index 490883671..9a943696f 100644 --- a/src/agentscope/models/dashscope_model.py +++ b/src/agentscope/models/dashscope_model.py @@ -85,36 +85,37 @@ class DashScopeChatWrapper(DashScopeWrapperBase): """The model wrapper for DashScope's chat API, refer to https://help.aliyun.com/zh/dashscope/developer-reference/api-details - Response: + Example Response: - Refer to https://help.aliyun.com/zh/dashscope/developer-reference/quick-start?spm=a2c4g.11186623.0.0.7e346eb5RvirBw - ```json - { - "status_code": 200, - "request_id": "a75a1b22-e512-957d-891b-37db858ae738", - "code": "", - "message": "", - "output": { - "text": null, - "finish_reason": null, - "choices": [ - { - "finish_reason": "stop", - "message": { - "role": "assistant", - "content": "xxx" + .. code-block:: json + + { + "status_code": 200, + "request_id": "a75a1b22-e512-957d-891b-37db858ae738", + "code": "", + "message": "", + "output": { + "text": null, + "finish_reason": null, + "choices": [ + { + "finish_reason": "stop", + "message": { + "role": "assistant", + "content": "xxx" + } } - } - ] - }, - "usage": { - "input_tokens": 25, - "output_tokens": 77, - "total_tokens": 102 + ] + }, + "usage": { + "input_tokens": 25, + "output_tokens": 77, + "total_tokens": 102 + } } - } - ``` + """ model_type: str = "dashscope_chat" @@ -409,34 +410,35 @@ class DashScopeImageSynthesisWrapper(DashScopeWrapperBase): - Refer to https://help.aliyun.com/zh/dashscope/developer-reference/api-details-9?spm=a2c4g.11186623.0.0.7108fa70Op6eqF - ```json - { - "status_code": 200, - "request_id": "b54ffeb8-6212-9dac-808c-b3771cba3788", - "code": null, - "message": "", - "output": { - "task_id": "996523eb-034d-459b-ac88-b340b95007a4", - "task_status": "SUCCEEDED", - "results": [ - { - "url": "RESULT_URL1" - }, - { - "url": "RESULT_URL2" - }, - ], - "task_metrics": { - "TOTAL": 2, - "SUCCEEDED": 2, - "FAILED": 0 + .. code-block:: json + + { + "status_code": 200, + "request_id": "b54ffeb8-6212-9dac-808c-b3771cba3788", + "code": null, + "message": "", + "output": { + "task_id": "996523eb-034d-459b-ac88-b340b95007a4", + "task_status": "SUCCEEDED", + "results": [ + { + "url": "RESULT_URL1" + }, + { + "url": "RESULT_URL2" + }, + ], + "task_metrics": { + "TOTAL": 2, + "SUCCEEDED": 2, + "FAILED": 0 + } + }, + "usage": { + "image_count": 2 } - }, - "usage": { - "image_count": 2 } - } - ``` + """ model_type: str = "dashscope_image_synthesis" @@ -534,27 +536,28 @@ class DashScopeTextEmbeddingWrapper(DashScopeWrapperBase): - Refer to https://help.aliyun.com/zh/dashscope/developer-reference/text-embedding-api-details?spm=a2c4g.11186623.0.i3 - ```json - { - "status_code": 200, // 200 indicate success otherwise failed. - "request_id": "fd564688-43f7-9595-b986", // The request id. - "code": "", // If failed, the error code. - "message": "", // If failed, the error message. - "output": { - "embeddings": [ // embeddings - { - "embedding": [ // one embedding output - -3.8450357913970947, ..., - ], - "text_index": 0 // the input index. - } - ] - }, - "usage": { - "total_tokens": 3 // the request tokens. + .. code-block:: json + + { + "status_code": 200, // 200 indicate success otherwise failed. + "request_id": "fd564688-43f7-9595-b986", // The request id. + "code": "", // If failed, the error code. + "message": "", // If failed, the error message. + "output": { + "embeddings": [ // embeddings + { + "embedding": [ // one embedding output + -3.8450357913970947, ..., + ], + "text_index": 0 // the input index. + } + ] + }, + "usage": { + "total_tokens": 3 // the request tokens. + } } - } - ``` + """ model_type: str = "dashscope_text_embedding" @@ -645,36 +648,37 @@ class DashScopeMultiModalWrapper(DashScopeWrapperBase): - Refer to https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl-plus-api?spm=a2c4g.11186623.0.0.7fde1f5atQSalN - ```json - { - "status_code": 200, - "request_id": "a0dc436c-2ee7-93e0-9667-c462009dec4d", - "code": "", - "message": "", - "output": { - "text": null, - "finish_reason": null, - "choices": [ - { - "finish_reason": "stop", - "message": { - "role": "assistant", - "content": [ - { - "text": "这张图片显..." - } - ] + .. code-block:: json + + { + "status_code": 200, + "request_id": "a0dc436c-2ee7-93e0-9667-c462009dec4d", + "code": "", + "message": "", + "output": { + "text": null, + "finish_reason": null, + "choices": [ + { + "finish_reason": "stop", + "message": { + "role": "assistant", + "content": [ + { + "text": "这张图片显..." + } + ] + } } - } - ] - }, - "usage": { - "input_tokens": 1277, - "output_tokens": 81, - "image_tokens": 1247 + ] + }, + "usage": { + "input_tokens": 1277, + "output_tokens": 81, + "image_tokens": 1247 + } } - } - ``` + """ model_type: str = "dashscope_multimodal" @@ -787,26 +791,25 @@ def format( The multimodal API has the following requirements: - - The roles of messages must alternate between "user" and - "assistant". - - The message with the role "system" should be the first message - in the list. - - If the system message exists, then the second message must - have the role "user". - - The last message in the list should have the role "user". - - In each message, more than one figure is allowed. + - The roles of messages must alternate between "user" and "assistant". + - The message with the role "system" should be the first message + in the list. + - If the system message exists, then the second message must + have the role "user". + - The last message in the list should have the role "user". + - In each message, more than one figure is allowed. With the above requirements, we format the messages as follows: - - If the first message is a system message, then we will keep it as - system prompt. - - We merge all messages into a conversation history prompt in a - single message with the role "user". - - When there are multiple figures in the given messages, we will - attach it to the user message by order. Note if there are - multiple figures, this strategy may cause misunderstanding for - the model. For advanced solutions, developers are encouraged to - implement their own prompt engineering strategies. + - If the first message is a system message, then we will keep it as + system prompt. + - We merge all messages into a conversation history prompt in a + single message with the role "user". + - When there are multiple figures in the given messages, we will + attach it to the user message by order. Note if there are + multiple figures, this strategy may cause misunderstanding for + the model. For advanced solutions, developers are encouraged to + implement their own prompt engineering strategies. The following is an example: @@ -832,7 +835,7 @@ def format( The prompt will be as follows: - .. code-block:: python + .. code-block:: json [ { diff --git a/src/agentscope/models/gemini_model.py b/src/agentscope/models/gemini_model.py index 3eaa301fb..2ca8cd114 100644 --- a/src/agentscope/models/gemini_model.py +++ b/src/agentscope/models/gemini_model.py @@ -407,15 +407,16 @@ class GeminiEmbeddingWrapper(GeminiWrapperBase): Response: - Refer to https://ai.google.dev/api/embeddings?hl=zh-cn#response-body - ```json - { - "embeddings": [ - { - object (ContentEmbedding) - } - ] - } - ``` + .. code-block:: json + + { + "embeddings": [ + { + object (ContentEmbedding) + } + ] + } + """ model_type: str = "gemini_embedding" diff --git a/src/agentscope/models/litellm_model.py b/src/agentscope/models/litellm_model.py index 24399ad58..31f1eba26 100644 --- a/src/agentscope/models/litellm_model.py +++ b/src/agentscope/models/litellm_model.py @@ -84,27 +84,28 @@ class LiteLLMChatWrapper(LiteLLMWrapperBase): Response: - From https://docs.litellm.ai/docs/completion/output - ```json - { - 'choices': [ - { - 'finish_reason': str, # String: 'stop' - 'index': int, # Integer: 0 - 'message': { # Dictionary [str, str] - 'role': str, # String: 'assistant' - 'content': str # String: "default message" + .. code-block:: json + + { + 'choices': [ + { + 'finish_reason': str, # String: 'stop' + 'index': int, # Integer: 0 + 'message': { # Dictionary [str, str] + 'role': str, # String: 'assistant' + 'content': str # String: "default message" + } } + ], + 'created': str, # String: None + 'model': str, # String: None + 'usage': { # Dictionary [str, int] + 'prompt_tokens': int, # Integer + 'completion_tokens': int, # Integer + 'total_tokens': int # Integer } - ], - 'created': str, # String: None - 'model': str, # String: None - 'usage': { # Dictionary [str, int] - 'prompt_tokens': int, # Integer - 'completion_tokens': int, # Integer - 'total_tokens': int # Integer } - } - ``` + """ model_type: str = "litellm_chat" diff --git a/src/agentscope/models/ollama_model.py b/src/agentscope/models/ollama_model.py index bcb6bc18b..f4dcae567 100644 --- a/src/agentscope/models/ollama_model.py +++ b/src/agentscope/models/ollama_model.py @@ -81,23 +81,24 @@ class OllamaChatWrapper(OllamaWrapperBase): - Refer to https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion - ```json - { - "model": "registry.ollama.ai/library/llama3:latest", - "created_at": "2023-12-12T14:13:43.416799Z", - "message": { - "role": "assistant", - "content": "Hello! How are you today?" - }, - "done": true, - "total_duration": 5191566416, - "load_duration": 2154458, - "prompt_eval_count": 26, - "prompt_eval_duration": 383809000, - "eval_count": 298, - "eval_duration": 4799921000 - } - ``` + .. code-block:: json + + { + "model": "registry.ollama.ai/library/llama3:latest", + "created_at": "2023-12-12T14:13:43.416799Z", + "message": { + "role": "assistant", + "content": "Hello! How are you today?" + }, + "done": true, + "total_duration": 5191566416, + "load_duration": 2154458, + "prompt_eval_count": 26, + "prompt_eval_duration": 383809000, + "eval_count": 298, + "eval_duration": 4799921000 + } + """ model_type: str = "ollama_chat" @@ -384,15 +385,16 @@ class OllamaEmbeddingWrapper(OllamaWrapperBase): - Refer to https://github.com/ollama/ollama/blob/main/docs/api.md#generate-embeddings - ```json - { - "model": "all-minilm", - "embeddings": [[ - 0.010071029, -0.0017594862, 0.05007221, 0.04692972, - 0.008599704, 0.105441414, -0.025878139, 0.12958129, - ]] - } - ``` + .. code-block:: json + + { + "model": "all-minilm", + "embeddings": [[ + 0.010071029, -0.0017594862, 0.05007221, 0.04692972, + 0.008599704, 0.105441414, -0.025878139, 0.12958129, + ]] + } + """ model_type: str = "ollama_embedding" @@ -482,21 +484,22 @@ class OllamaGenerationWrapper(OllamaWrapperBase): - From https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-completion - ```json - { - "model": "llama3", - "created_at": "2023-08-04T19:22:45.499127Z", - "response": "The sky is blue because it is the color of the sky.", - "done": true, - "context": [1, 2, 3], - "total_duration": 5043500667, - "load_duration": 5025959, - "prompt_eval_count": 26, - "prompt_eval_duration": 325953000, - "eval_count": 290, - "eval_duration": 4709213000 - } - ``` + .. code-block:: json + + { + "model": "llama3", + "created_at": "2023-08-04T19:22:45.499127Z", + "response": "The sky is blue because it is the color of sky.", + "done": true, + "context": [1, 2, 3], + "total_duration": 5043500667, + "load_duration": 5025959, + "prompt_eval_count": 26, + "prompt_eval_duration": 325953000, + "eval_count": 290, + "eval_duration": 4709213000 + } + """ model_type: str = "ollama_generate" diff --git a/src/agentscope/models/openai_model.py b/src/agentscope/models/openai_model.py index ec6032c62..35b50eb0f 100644 --- a/src/agentscope/models/openai_model.py +++ b/src/agentscope/models/openai_model.py @@ -31,31 +31,32 @@ class OpenAIWrapperBase(ModelWrapperBase, ABC): Response: - From https://platform.openai.com/docs/api-reference/chat/create - ```json - { - "id": "chatcmpl-123", - "object": "chat.completion", - "created": 1677652288, - "model": "gpt-4o-mini", - "system_fingerprint": "fp_44709d6fcb", - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Hello there, how may I assist you today?", - }, - "logprobs": null, - "finish_reason": "stop" + .. code-block:: json + + { + "id": "chatcmpl-123", + "object": "chat.completion", + "created": 1677652288, + "model": "gpt-4o-mini", + "system_fingerprint": "fp_44709d6fcb", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Hello there, how may I assist you?", + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 9, + "completion_tokens": 12, + "total_tokens": 21 } - ], - "usage": { - "prompt_tokens": 9, - "completion_tokens": 12, - "total_tokens": 21 } - } - ``` + """ def __init__( @@ -504,19 +505,20 @@ class OpenAIDALLEWrapper(OpenAIWrapperBase): Response: - Refer to https://platform.openai.com/docs/api-reference/images/create - ```json - { - "created": 1589478378, - "data": [ - { - "url": "https://..." - }, - { - "url": "https://..." - } - ] - } - ``` + .. code-block:: json + + { + "created": 1589478378, + "data": [ + { + "url": "https://..." + }, + { + "url": "https://..." + } + ] + } + """ model_type: str = "openai_dall_e" @@ -631,28 +633,29 @@ class OpenAIEmbeddingWrapper(OpenAIWrapperBase): - Refer to https://platform.openai.com/docs/api-reference/embeddings/create - ```json - { - "object": "list", - "data": [ - { - "object": "embedding", - "embedding": [ - 0.0023064255, - -0.009327292, - .... (1536 floats total for ada-002) - -0.0028842222, - ], - "index": 0 + .. code-block:: json + + { + "object": "list", + "data": [ + { + "object": "embedding", + "embedding": [ + 0.0023064255, + -0.009327292, + .... (1536 floats total for ada-002) + -0.0028842222, + ], + "index": 0 + } + ], + "model": "text-embedding-ada-002", + "usage": { + "prompt_tokens": 8, + "total_tokens": 8 } - ], - "model": "text-embedding-ada-002", - "usage": { - "prompt_tokens": 8, - "total_tokens": 8 } - } - ``` + """ model_type: str = "openai_embedding" diff --git a/src/agentscope/models/yi_model.py b/src/agentscope/models/yi_model.py index 0acc314d2..ecd426662 100644 --- a/src/agentscope/models/yi_model.py +++ b/src/agentscope/models/yi_model.py @@ -25,29 +25,30 @@ class YiChatWrapper(ModelWrapperBase): Response: - From https://platform.lingyiwanwu.com/docs - ```json - { - "id": "cmpl-ea89ae83", - "object": "chat.completion", - "created": 5785971, - "model": "yi-large-rag", - "usage": { - "completion_tokens": 113, - "prompt_tokens": 896, - "total_tokens": 1009 - }, - "choices": [ - { - "index": 0, - "message": { - "role": "assistant", - "content": "Today in Los Angeles, the weather ...", - }, - "finish_reason": "stop" - } - ] - } - ``` + .. code-block:: json + + { + "id": "cmpl-ea89ae83", + "object": "chat.completion", + "created": 5785971, + "model": "yi-large-rag", + "usage": { + "completion_tokens": 113, + "prompt_tokens": 896, + "total_tokens": 1009 + }, + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "Today in Los Angeles, the weather ...", + }, + "finish_reason": "stop" + } + ] + } + """ model_type: str = "yi_chat" diff --git a/src/agentscope/models/zhipu_model.py b/src/agentscope/models/zhipu_model.py index 27455ba9e..c4d3d9217 100644 --- a/src/agentscope/models/zhipu_model.py +++ b/src/agentscope/models/zhipu_model.py @@ -84,29 +84,30 @@ class ZhipuAIChatWrapper(ZhipuAIWrapperBase): Response: - From https://maas.aminer.cn/dev/api#glm-4 - ```json - { - "created": 1703487403, - "id": "8239375684858666781", - "model": "glm-4", - "request_id": "8239375684858666781", - "choices": [ - { - "finish_reason": "stop", - "index": 0, - "message": { - "content": "Drawing blueprints with ...", - "role": "assistant" + .. code-block:: json + + { + "created": 1703487403, + "id": "8239375684858666781", + "model": "glm-4", + "request_id": "8239375684858666781", + "choices": [ + { + "finish_reason": "stop", + "index": 0, + "message": { + "content": "Drawing blueprints with ...", + "role": "assistant" + } } + ], + "usage": { + "completion_tokens": 217, + "prompt_tokens": 31, + "total_tokens": 248 } - ], - "usage": { - "completion_tokens": 217, - "prompt_tokens": 31, - "total_tokens": 248 } - } - ``` + """ model_type: str = "zhipuai_chat" @@ -371,30 +372,31 @@ class ZhipuAIEmbeddingWrapper(ZhipuAIWrapperBase): Example Response: - ```json - { - "model": "embedding-2", - "data": [ + .. code-block:: json + { - "embedding": [ (a total of 1024 elements) - -0.02675454691052437, - 0.019060475751757622, - ...... - -0.005519774276763201, - 0.014949671924114227 + "model": "embedding-2", + "data": [ + { + "embedding": [ (a total of 1024 elements) + -0.02675454691052437, + 0.019060475751757622, + ...... + -0.005519774276763201, + 0.014949671924114227 + ], + "index": 0, + "object": "embedding" + } ], - "index": 0, - "object": "embedding" + "object": "list", + "usage": { + "completion_tokens": 0, + "prompt_tokens": 4, + "total_tokens": 4 + } } - ], - "object": "list", - "usage": { - "completion_tokens": 0, - "prompt_tokens": 4, - "total_tokens": 4 - } - } - ``` + """ model_type: str = "zhipuai_embedding"