agentscope-ai / agentscope-ai/agentscope-runtime

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

Đang mở
#461 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
863
Fork
168
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

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.