mirror of
https://github.com/SilasMarvin/lsp-ai.git
synced 2024-09-11 12:25:48 +03:00
Merge pull request #7 from SilasMarvin/silas-fix-anthropic-api
Fixed Anthropic API by creating OpenAIChatMessage
This commit is contained in:
commit
f84b5fe2be
@ -36,7 +36,6 @@ pub enum ValidModel {
|
||||
pub struct ChatMessage {
|
||||
pub role: String,
|
||||
pub content: String,
|
||||
pub tool_calls: Option<Value>, // This is to be compatible with Mistral
|
||||
}
|
||||
|
||||
impl ChatMessage {
|
||||
@ -44,7 +43,7 @@ impl ChatMessage {
|
||||
Self {
|
||||
role,
|
||||
content,
|
||||
tool_calls: None,
|
||||
// tool_calls: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use anyhow::Context;
|
||||
use serde::Deserialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{json, Value};
|
||||
use tracing::instrument;
|
||||
|
||||
@ -71,9 +71,15 @@ struct OpenAICompletionsResponse {
|
||||
pub other: HashMap<String, Value>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct OpenAIChatMessage {
|
||||
pub role: String,
|
||||
pub content: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct OpenAIChatChoices {
|
||||
pub message: ChatMessage,
|
||||
pub message: OpenAIChatMessage,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
Loading…
Reference in New Issue
Block a user