Adding ability to deserialize requests

This commit is contained in:
Ryan Olson
2024-02-12 19:29:24 +00:00
parent 7fe9f4efae
commit a8635b918e
2 changed files with 3 additions and 3 deletions

View File

@ -6,14 +6,14 @@ use std::collections::HashMap;
use crate::impl_builder_methods; use crate::impl_builder_methods;
use crate::v1::common; use crate::v1::common;
#[derive(Debug, Serialize, Clone, PartialEq, Eq)] #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub enum ToolChoiceType { pub enum ToolChoiceType {
None, None,
Auto, Auto,
ToolChoice { tool: Tool }, ToolChoice { tool: Tool },
} }
#[derive(Debug, Serialize, Clone)] #[derive(Debug, Serialize, Deserialze, Clone)]
pub struct ChatCompletionRequest { pub struct ChatCompletionRequest {
pub model: String, pub model: String,
pub messages: Vec<ChatCompletionMessage>, pub messages: Vec<ChatCompletionMessage>,

View File

@ -18,7 +18,7 @@ pub const GPT3_CURIE: &str = "curie";
pub const GPT3_ADA: &str = "ada"; pub const GPT3_ADA: &str = "ada";
pub const GPT3_BABBAGE: &str = "babbage"; pub const GPT3_BABBAGE: &str = "babbage";
#[derive(Debug, Serialize, Clone)] #[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CompletionRequest { pub struct CompletionRequest {
pub model: String, pub model: String,
pub prompt: String, pub prompt: String,