Skip to content

Commit

Permalink
Merge pull request #78 from ryanolson/deserialize_completion_reqs
Browse files Browse the repository at this point in the history
Adding ability to deserialize completion and chat completion requests
  • Loading branch information
Dongri Jin authored Feb 12, 2024
2 parents 7fe9f4e + bd57dbb commit 9e3dcb9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/v1/chat_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use std::collections::HashMap;
use crate::impl_builder_methods;
use crate::v1::common;

#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
pub enum ToolChoiceType {
None,
Auto,
ToolChoice { tool: Tool },
}

#[derive(Debug, Serialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ChatCompletionRequest {
pub model: String,
pub messages: Vec<ChatCompletionMessage>,
Expand Down
2 changes: 1 addition & 1 deletion src/v1/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub const GPT3_CURIE: &str = "curie";
pub const GPT3_ADA: &str = "ada";
pub const GPT3_BABBAGE: &str = "babbage";

#[derive(Debug, Serialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CompletionRequest {
pub model: String,
pub prompt: String,
Expand Down

0 comments on commit 9e3dcb9

Please sign in to comment.