agentscope-ai / agentscope-ai/agentscope-java

[Feature]: Support Declarative Multi-Agent & Multi-Provider Configuration in Spring Boot

オープン
#2,096 コメント 2 件 リアクション 0 件 担当者 1 名 @jujn が担当を希望しています GitHub で見る
area/ext/spring-boot enhancement
主要言語
Java
スター
5.6k
フォーク
1.3k
平均マージ
4日 12時間
マージ済み PR(30日)
77

説明

## The Problem

Currently, AgentScope-Java's Spring Boot Auto-Configuration only supports declaring a **single Agent instance**. This is a major blocker for real-world business scenarios where multiple agents are needed to handle different tasks.

We lack a declarative way to:
- Configure **multiple LLM providers** (OpenAI, DashScope, Anthropic, Gemini, Ollama, etc.) simultaneously.
- Define **multiple models** under each provider with independent parameters.
- Declare **multiple agents** that reference different models and carry different system prompts.
- Dynamically **resolve agents by name** at runtime without manual Spring Bean injection.
- Register **custom tools** and reference them in agent configurations by name.

Without this, every team has to build their own integration layer, leading to duplicated effort and inconsistency.

## Proposed Solution

Native Spring Boot `@AutoConfiguration` / `@ConfigurationProperties` support that enables developers to define Providers, Models, and Agents purely through YAML configuration:

agentscope:

providers:
my-openai:
name: "My OpenAI"
api-key: "sk-xxx"
provider-type: "openai"
base-url: "https://api.openai.com/v1/"
models:
gpt-4o:
name: "GPT-4o"
model-name: "gpt-4o"
generate-options:
temperature: 0.7
max-tokens: 4096

agents:
translator:
name: "Translator"
model: "my-openai:gpt-4o"
sys-prompt: "You are a translator."
max-iters: 10
analyzer:
name: "Analyzer"
model: "my-openai:gpt-4o"
sys-prompt: "You are an analyst."
toolkit:
- my-tool

Additionally, provide a simple static API to resolve agents by name at runtime:

ReActAgent agent = AgentRegistry.resolve("translator");

And support registering custom tools to be referenced by name in agent config:

AgentRegistry.registerTool("my-tool", new MyCustomTool());

## Alternatives Considered

- Writing manual Java code for each agent.
- Wrapping agents behind custom service layers.

Both approaches require significant boilerplate and become hard to maintain as the number of providers or agents grows.

## Additional Context

N/A

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。