agentscope-ai / agentscope-ai/agentscope-java
[Feature]:工具调用参数检查校验及自动修复增强
- Linguagem predominante
- Java
- Estrelas
- 5.6k
- Forks
- 1.3k
- Merge médio
- 4d 12h
- PRs com merge (30d)
- 77
Descrição
When working with LLM tool calls, we frequently encounter malformed JSON in tool call arguments. Common issues include:
- Markdown code blocks: Arguments wrapped in \json ... `
- JSON comments: // or /* */ comments that aren't valid JSON
- Single quotes: Using ' instead of " for strings/keys
- Missing braces: Incomplete JSON objects
- Trailing commas: Commas after last element (not valid in strict JSON)
These issues cause the current ChatMessageConverter to fail when parsing tool arguments, requiring manual intervention or rejecting otherwise valid tool calls.
Example problematic inputs:
```
```json
{"query": "test"} // Simple search
{'query': 'test',}
{"query": "test",}
{"query": "test", “condition”: {"id": "123"}
```
Implement a **robust multi-stage tool argument parser** that progressively cleans up malformed JSON before parsing.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.