agentscope.middlewareParameters
class Parameters(BaseModel)
agentscope/middleware/_longterm_memory/_reme/_middleware.py:131–182参数,驱动智能体的推理、工具调用与会话执行。位于 agentscope.middleware 包。
The agent service parses this schema to render a configuration
form. Structural wiring (workspace_dir) stays on the constructor.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
model_config | — | 模型配置字段。 | {'arbitrary_types_allowed': True} |
chat_model | ChatModelBase | None | 聊天模型字段。 | Field(default=None, title='Chat Model', description="AgentScope chat model injected into the embedded app's default-named LLM component, fixed for the lifetime of the app. When `None`, the AgentScope ReMe config supplies the LLM. Needed for `auto_memory` write-back.") |
embedding_model | EmbeddingModelBase | None | 向量化模型字段。 | Field(default=None, title='Embedding Model', description="AgentScope embedding model injected into the embedded app's default-named embedding component, fixed for the lifetime of the app. In the AgentScope minimal config, `None` keeps search keyword-only; providing a model enables vector search.") |
mode | Literal['static_control', 'agent_control', 'both'] | 模式字段。 | Field(default='both', title='Retrieval Mode', description='How the agent retrieves from ReMe (write-back runs automatically in every mode). `static_control`: search and inject before each reply, no tool. `agent_control`: expose the `memory_search` tool, no auto-retrieval. `both`: auto-retrieve/inject and expose the tool.') |
top_k | int | `top_k` 字段。 | Field(default=5, title='Top K', description='Max number of memories retrieved per search, and the default `limit` advertised by the `memory_search` tool.') |
属性详情Attribute Detail
model_config
= {'arbitrary_types_allowed': True}模型配置字段。
The model config field.
agentscope/middleware/_longterm_memory/_reme/_middleware.py:138chat_model
ChatModelBase | None = Field(default=None, title='Chat Model', description="AgentScope chat model injected into the embedded app's default-named LLM component, fixed for the lifetime of the app. When `None`, the AgentScope ReMe config supplies the LLM. Needed for `auto_memory` write-back.")聊天模型字段。声明为 ChatModelBase | None。
AgentScope chat model injected into the embedded app's default-named LLM component, fixed for the lifetime of the app.
agentscope/middleware/_longterm_memory/_reme/_middleware.py:140embedding_model
EmbeddingModelBase | None = Field(default=None, title='Embedding Model', description="AgentScope embedding model injected into the embedded app's default-named embedding component, fixed for the lifetime of the app. In the AgentScope minimal config, `None` keeps search keyword-only; providing a model enables vector search.")向量化模型字段。声明为 EmbeddingModelBase | None。
AgentScope embedding model injected into the embedded app's default-named embedding component, fixed for the lifetime of the app.
agentscope/middleware/_longterm_memory/_reme/_middleware.py:151mode
Literal['static_control', 'agent_control', 'both'] = Field(default='both', title='Retrieval Mode', description='How the agent retrieves from ReMe (write-back runs automatically in every mode). `static_control`: search and inject before each reply, no tool. `agent_control`: expose the `memory_search` tool, no auto-retrieval. `both`: auto-retrieve/inject and expose the tool.')模式字段。声明为 Literal['static_control', 'agent_control', 'both']。
How the agent retrieves from ReMe (write-back runs automatically in every mode).
agentscope/middleware/_longterm_memory/_reme/_middleware.py:163top_k
int = Field(default=5, title='Top K', description='Max number of memories retrieved per search, and the default `limit` advertised by the `memory_search` tool.')top_k 字段。声明为 int。
Max number of memories retrieved per search, and the default limit advertised by the memory_search tool.
agentscope/middleware/_longterm_memory/_reme/_middleware.py:175