Skip to content

设置项说明

当项目开始变复杂时,设置项决定了你能不能把行为稳定下来、把问题定位出来。

适合什么时候读

  • 你已经跑通最小示例,准备把配置收敛成工程化结构
  • 你需要理解全局、Agent、Request/Session 的继承关系
  • 你要排查日志、请求参数或 Session 行为

你会学到什么

  • Agently 设置项分层怎么工作
  • 哪些设置最值得优先掌握
  • OpenAICompatible、运行日志和 Session 相关配置在哪里看

配置层级

这张图放在正文里,是为了强调:遇到配置异常时,先定位是哪个层级拥有这个值。

最小示例

python
from agently import Agently

Agently.set_settings("runtime.show_model_logs", True)

agent = Agently.create_agent()
agent.set_settings("prompt.add_current_time", True)

你最可能先用到的几组设置

Prompt

  • prompt.add_current_time
  • prompt.role_mapping
  • prompt.prompt_title_mapping

Response

  • response.streaming_parse
  • response.streaming_parse_path_style

Runtime / Debug

  • runtime.show_model_logs
  • runtime.show_tool_logs
  • runtime.show_trigger_flow_logs
  • runtime.httpx_log_level
  • debug

OpenAICompatible

  • model_type
  • model
  • base_url
  • request_options
  • stream

Session

  • session.max_length
  • session.input_keys
  • session.reply_keys

OpenAICompatible 配置入口

参数覆盖、tools 两套机制和 request body 细节,继续看:

Session 配置入口

如果你当前关注的是会话记忆和上下文窗口,继续看:

常见误区

  • 所有配置都堆在一个脚本里,后期不知道是谁覆盖了谁。
  • 只改请求层选项,却忽略了插件层设置才是最终 owner。
  • 调试问题时不开日志,靠猜。

下一步去哪

  • agently-model-setup
  • agently-session-memory