Files
2025-05-21 17:57:53 +08:00

1.1 KiB
Raw Permalink Blame History

Service

agentUniverse允许开发者使用简单模版定义的方式将开发完成的Agent注册为一个Service能够在启动内置的Web服务器后通过调用Web API使用对应的Agent服务。

注册方式

第一步:配置扫描路径

agentUniverse通过在应用启动时扫描配置路径的方式寻找Service的配置文件并进行自动注册扫描的路径配置在配置文件config.toml中:

[CORE_PACKAGE]
default = ['default_scan_path']
service = ['service_scan_path']

agentUniverse默认会扫描defaultservice中的所有路径,service下的路径配置优先级高于default

第二步:配置文件

name: 'service_name'
description: 'description of the service'
agent: 'agent_name'
metadata:
  type: 'SERVICE'
  • name:Service的名称在Web API中调用服务时需要传入该名称。
  • description:对Service功能的描述。
  • agent:Agent的名称关于Agent的具体内容请参考Agent
  • metadata:表示该配置是一个Service配置无需改动。

使用方式

请参考Web API.