ci: add Gitea CI, RPM spec, license, and repo hygiene
- Add .gitea/workflows/ci.yml with fmt/clippy/test on all branches and SRPM build + COPR publish on version tags - Add cortex.spec for Fedora RPM packaging - Add GPL-3.0-or-later LICENSE file - Add cortex.example.toml with generic hostnames; gitignore cortex.toml - Scrub infrastructure-specific hostnames from README.md, CLAUDE.md, and doc comments - Fix unused imports and clippy warnings to pass -D warnings - Fix missing deps (bytes, reqwest, serde_json) exposed during build - Run cargo fmt across workspace - Update SPDX license identifier to GPL-3.0-or-later Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,14 +3,12 @@
|
||||
//! This is a stateless transformation — no context is carried between requests.
|
||||
|
||||
use crate::anthropic::{
|
||||
AnthropicContent, AnthropicMessage, AnthropicUsage, ContentBlock, MessagesRequest,
|
||||
MessagesResponse, SystemPrompt,
|
||||
AnthropicContent, AnthropicUsage, ContentBlock, MessagesRequest, MessagesResponse, SystemPrompt,
|
||||
};
|
||||
use crate::openai::{
|
||||
ChatCompletionChoice, ChatCompletionRequest, ChatCompletionResponse, ChatMessage, Usage,
|
||||
MessageContent,
|
||||
ChatCompletionRequest, ChatCompletionResponse, ChatMessage, MessageContent, Usage,
|
||||
};
|
||||
use serde_json::{json, Value};
|
||||
use serde_json::{Value, json};
|
||||
|
||||
/// Convert an Anthropic Messages request into an OpenAI ChatCompletion request.
|
||||
pub fn anthropic_to_openai(req: MessagesRequest) -> ChatCompletionRequest {
|
||||
@@ -45,9 +43,7 @@ pub fn anthropic_to_openai(req: MessagesRequest) -> ChatCompletionRequest {
|
||||
.to_string();
|
||||
MessageContent::Text(text)
|
||||
} else {
|
||||
MessageContent::Parts(
|
||||
blocks.into_iter().map(|b| json!(b)).collect(),
|
||||
)
|
||||
MessageContent::Parts(blocks.into_iter().map(|b| json!(b)).collect())
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user