agentscope-ai / agentscope-ai/agentscope-java

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

Đang mở
#2,096 2 bình luận 0 reaction 1 người được giao Được @jujn nhận Xem trên GitHub
area/ext/spring-boot enhancement
Ngôn ngữ chính
Java
Star
5.6k
Fork
1.3k
Merge trung bình
4 ngày 12 giờ
Pull request đã merge (30 ngày)
77

Mô tả

## 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.