agentscope-ai / agentscope-ai/agentscope-runtime

[Bug] agentscope-runtime's AgentRole is not compatible for agentscope-java's MsgRole

Aperta
#461 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
863
Fork
168
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Bug Description
agentscope-runtime's AgentRole is lowercase
agentscope-java's MsgRole is uppercase

when i send http request with agentscope-java's msg(`io.agentscope.core.message.Msg`) to copaw(deploy on agentscope-runtime), copaw return error:
```
1 validation error for AgentRequest
input.0.role
Input should be 'assistant', 'system', 'user' or 'tool' [type=literal_error, input_value='USER'
```

## Reproduction Steps
```java
Request request = new Request<>();
List msgs = new ArrayList<>();
msgs.add(Msg.builder()
.role(MsgRole.USER)
.content(TextBlock.builder()
.text("你是谁")
.build())
.build());
request.setInput(msgs);
ObjectMapper objectMapper = new ObjectMapper();
String body = objectMapper.writeValueAsString(request);
WebClient client = WebClient.builder()
.baseUrl("http://127.0.0.1:8088")
.build();
Flux stream = client.post()
.uri("/api/agent/process")
.header("Content-Type", "application/json")
.bodyValue(body)
.retrieve()
.bodyToFlux(ResponseChunk.class);
stream.subscribe(s -> log.info("receive {}", s));
```

## Expected vs Actual Behavior
**Expected:** receive many normal ResponseChunk...
**Actual:** receive one ResponseChunk, error is
```
1 validation error for AgentRequest
input.0.role Input should be 'assistant', 'system', 'user' or 'tool' [type=literal_error, input_value='USER'
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.