Skip to content

feat: synchronize fork with upstream v0.6.0-alpha.2#4

Merged
AlexMikhalev merged 126 commits intomainfrom
feature/merge-upstream-v0.6.0-alpha.2
Feb 7, 2026
Merged

feat: synchronize fork with upstream v0.6.0-alpha.2#4
AlexMikhalev merged 126 commits intomainfrom
feature/merge-upstream-v0.6.0-alpha.2

Conversation

@AlexMikhalev
Copy link

Summary

  • Merge 124 upstream commits from jeremychone/rust-genai v0.6.0-alpha.2
  • Preserve all fork-specific adapters (Bedrock, Cerebras, OpenRouter, Zhipu)
  • Integrate new upstream features (ModelSpec, MIMO, BigModel, enhanced ZAI)
  • Fix API changes and resolve 12 merge conflicts

Changes

Upstream Features Integrated

  • ModelSpec API: Enhanced model specification system
  • MIMO Adapter: New provider support
  • BigModel Adapter: bigmodel.cn provider support
  • Enhanced ZAI: Dual endpoint support (zai::, zai-coding::), renamed to "Zai"
  • Cache Control TTL: Anthropic cache with 5m/1h TTL options

Fork Features Preserved

  • AWS Bedrock: Converse API adapter with Bearer token auth
  • Cerebras: Fast inference provider
  • OpenRouter: Multi-provider routing
  • Zhipu: Legacy compatibility

Adapters (19 total)

OpenAI, OpenAIResp, Gemini, OpenRouter, Anthropic, Fireworks, Together, Groq, Mimo, Nebius, Xai, DeepSeek, Zai, BigModel, Cohere, Ollama, Cerebras, Bedrock, Zhipu

Test plan

  • cargo fmt --check - passes
  • cargo clippy - 6 warnings (all in upstream code)
  • cargo build - compiles successfully
  • cargo test --lib - 14/14 tests pass
  • cargo test --test mock_tests - 18/18 tests pass
  • cargo test --test test_adapter_consistency - verifies adapter code matches tests
  • cargo test --test test_verify_model_lists - verifies model resolution
  • cargo test --test test_zai_adapter - verifies ZAI adapter

Defects Resolved

Issue Resolution
Method as_model_name_and_namespace renamed Updated to namespace_and_name()
Duplicate size() methods Removed duplicates
ZAI adapter renamed "ZAi" -> "Zai" Updated all tests
ZAI model list changed Updated test expectations

Generated by Terraphim AI

pdylanross and others added 30 commits October 19, 2025 18:23
…eremychone#95)

- Rename zhipu adapter to zai adapter
- Implement namespace-based routing for regular vs coding endpoints
- Regular models: "glm-4.6" → credit-based API
- Coding models: "zai::glm-4.6" → subscription API
- Add comprehensive example c07-zai.rs
- Update adapter kind detection to handle "zai" namespace
- Remove dual-endpoint complexity from user-facing API

Co-authored-by: Rui Andrada <rui.andrada@imaginedone.com.br>
* feat: parts thought signature

* feat: gemini adapter thought signature support

- Add ContentPart::ThoughtSignature with accessors and helpers.
- Introduce InterStreamEvent::ThoughtSignatureChunk and ChatStreamEvent::ThoughtSignatureChunk.
- Capture thought signatures into StreamEnd.captured_content when enabled.
- Update printer to display ThoughtSignatureChunk events (non-captured).
- Gemini adapter: parse thoughtSignature (fallback: thought) and include in outgoing messages.
- Gemini streamer: surface thought as ThoughtSignatureChunk and record in captured_thought_signatures.
- Preserve thoughtSignature in assistant history before tool calls when looping tools.
- Example c10-tooluse-streaming.rs: switch to gemini-3-pro-preview, log thoughtSignature chunks, and prepend captured thoughts to assistant message.

* chore: impl thought signature

* chore: no API change
…opriate gemini thinkingLevel LOW/HIGH, fall back on budget if not gemini 3 or other effort
BinaryMuse and others added 29 commits January 21, 2026 15:16
…text parts (fixes jeremychone#135) (jeremychone#136)

Co-authored-by: Ross MacLeod <rmm+github@z.odi.ac>
- fix - anthropic - streaming adapter now captures cache tokens
^ cache - anthropic - Adds them to prompt_tokens (matching into_usage behavior)
^ cache - anthropic - add TTL support for prompt caching
- fix - anthropic - apply per-part cache_control on system messages and add cache TTL example
Merged 124 upstream commits from jeremychone/rust-genai while preserving
fork-specific adapters:
- AWS Bedrock (Converse API with Bearer token auth)
- Cerebras (OpenAI-compatible)
- OpenRouter (provider-pattern routing)
- Zhipu (legacy, backwards compatibility)

New features from upstream:
- ModelSpec API for flexible model specification
- MIMO and BigModel adapters
- Enhanced ZAI with dual-endpoint support (zai:: and zai-coding::)
- ThoughtSignature and ReasoningEffort improvements
- Custom EventSourceStream replacing reqwest-eventsource
- Enhanced error handling with request/response capture

Breaking changes:
- ZAi adapter renamed to Zai (upstream naming)
- ZAI model list updated to upstream v0.6.0-alpha.2

Conflict resolution:
- adapter_kind.rs: Merged all 19 adapter variants
- dispatcher.rs: Added fork adapters to upstream dispatch
- adapters/mod.rs: Export all adapter modules
- Accepted upstream for streaming and chat improvements

Tests updated for new adapter naming and model lists.

Co-Authored-By: Terraphim AI <noreply@terraphim.io>
Apply cargo fmt to fix minor formatting inconsistencies in:
- src/chat/tool/tool_response.rs (extra blank line)
- tests/test_verify_model_lists.rs (println formatting)
- tests/test_zai_adapter.rs (import order)

Co-Authored-By: Terraphim AI <noreply@terraphim.io>
@AlexMikhalev AlexMikhalev merged commit b6ba1b3 into main Feb 7, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.