AS AgentScopeAPI 手册 / API Reference
类class agentscope.middleware

Parameters

class Parameters(BaseModel)
源码Source 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_modelChatModelBase | 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_modelEmbeddingModelBase | 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.")
modeLiteral['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_kint
`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.

源码Source agentscope/middleware/_longterm_memory/_reme/_middleware.py:138

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.")

聊天模型字段。声明为 ChatModelBase | None。

AgentScope chat model injected into the embedded app's default-named LLM component, fixed for the lifetime of the app.

源码Source agentscope/middleware/_longterm_memory/_reme/_middleware.py:140

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.")

向量化模型字段。声明为 EmbeddingModelBase | None。

AgentScope embedding model injected into the embedded app's default-named embedding component, fixed for the lifetime of the app.

源码Source agentscope/middleware/_longterm_memory/_reme/_middleware.py:151

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.')

模式字段。声明为 Literal['static_control', 'agent_control', 'both']。

How the agent retrieves from ReMe (write-back runs automatically in every mode).

源码Source agentscope/middleware/_longterm_memory/_reme/_middleware.py:163

top_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.

源码Source agentscope/middleware/_longterm_memory/_reme/_middleware.py:175
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.