agentscope-ai / agentscope-ai/agentscope-runtime
[Bug] agentscope-runtime's AgentRole is not compatible for agentscope-java's MsgRole
- Linguagem predominante
- Python
- Estrelas
- 863
- Forks
- 168
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
## 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'
```
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.