feat: complete Rust backend UI compatibility

This commit is contained in:
boos
2026-05-18 16:52:54 +08:00
parent f2434e725d
commit f986fe0377
41 changed files with 3585 additions and 811 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
// Canonical response — unified output format for all providers
use crate::transformers::canonical::request::CanonicalMessage;
use crate::transformers::canonical::types::{StreamDelta, ToolCall, Usage};
use crate::transformers::canonical::types::{StreamDelta, Usage};
use serde::{Deserialize, Serialize};
/// Unified internal response format
+2
View File
@@ -1,4 +1,6 @@
// OpenAI chat/completions request → CanonicalRequest parser
#![allow(clippy::bind_instead_of_map, clippy::manual_map)]
use crate::transformers::canonical::{
CanonicalMessage, CanonicalRequest, ContentPart, ReasoningConfig, Role, ToolCall, ToolChoice,
ToolDefinition,
+2 -2
View File
@@ -1,6 +1,6 @@
// CanonicalResponse → OpenAI /v1/chat/completions JSON formatter
use crate::transformers::canonical::{
CanonicalChoice, CanonicalMessage, CanonicalResponse, ContentPart, Role, Usage,
CanonicalChoice, CanonicalMessage, CanonicalResponse, ContentPart, Role,
};
use serde_json::{json, Value};
@@ -115,7 +115,7 @@ fn format_content_parts(parts: &[ContentPart]) -> Value {
#[cfg(test)]
mod tests {
use super::*;
use crate::transformers::canonical::{CanonicalMessage, CanonicalResponse};
use crate::transformers::canonical::CanonicalResponse;
#[test]
fn test_format_simple_response() {
+2
View File
@@ -1,4 +1,6 @@
// OpenAI SSE stream parser and formatter
#![allow(clippy::unnecessary_filter_map)]
use crate::transformers::canonical::{
CanonicalStreamChoice, CanonicalStreamEvent, Role, StreamDelta, Usage,
};