mirror of
https://github.com/agentuniverse-ai/agentUniverse.git
synced 2026-02-09 01:59:19 +08:00
1.1 KiB
1.1 KiB
Service
agentUniverse允许开发者使用简单模版定义的方式将开发完成的Agent注册为一个Service,能够在启动内置的Web服务器后,通过调用Web API使用对应的Agent服务。
注册方式
第一步:配置扫描路径
agentUniverse通过在应用启动时扫描配置路径的方式寻找Service的配置文件并进行自动注册,扫描的路径配置在配置文件config.toml中:
[CORE_PACKAGE]
default = ['default_scan_path']
service = ['service_scan_path']
agentUniverse默认会扫描default或service中的所有路径,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.