Commit b42310e
authored
feat: added responses stream in cohere (#608)
## Summary
Implement Cohere ResponsesStream support and refactor token usage handling to improve reliability and reduce code duplication.
## Changes
- Added ResponsesStream implementation for Cohere provider
- Refactored token usage handling to use non-pointer float64 values
- Fixed content and tool call handling in streaming responses
- Simplified delta message content handling in stream events
- Reorganized code structure for better readability and maintainability
## Type of change
- [x] Bug fix
- [x] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI
## Affected areas
- [x] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [ ] UI (Next.js)
- [ ] Docs
## How to test
Test the Cohere provider with ResponsesStream functionality:
```sh
# Core/Transports
go version
go test ./...
# Test ResponsesStream with Cohere
curl -X POST "http://localhost:8000/v1/providers/cohere/responses-stream" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "command",
"messages": [
{"role": "user", "content": "Tell me about quantum computing"}
]
}'
```
## Screenshots/Recordings
N/A
## Breaking changes
- [ ] Yes
- [x] No
## Related issues
Implements ResponsesStream support for Cohere provider
## Security considerations
No security implications.
## Checklist
- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicableFile tree
6 files changed
+669
-223
lines changed- core
- providers
- schemas
- providers/cohere
6 files changed
+669
-223
lines changed
0 commit comments