openai-servant 0.2.2.0 → 0.2.3.0
raw patch · 2 files changed
+24/−23 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ OpenAI.Resources: [fStatus] :: File -> Text
- OpenAI.Resources: File :: FileId -> TimeStamp -> Text -> File
+ OpenAI.Resources: File :: FileId -> TimeStamp -> Text -> Text -> File
Files
- openai-servant.cabal +2/−2
- src/OpenAI/Resources.hs +22/−21
openai-servant.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: fa6a579e19b730c3c7362a8966f384ff312aaceb6cf8cdceff036ed2ec48f90b+-- hash: 27222b6af30e297958d20945ecd4e76ffe7b845bcf5513c5b23251ba3d290b5a name: openai-servant-version: 0.2.2.0+version: 0.2.3.0 synopsis: Unofficial OpenAI servant types description: Unofficial description of the OpenAI API using servant types category: Web
src/OpenAI/Resources.hs view
@@ -255,32 +255,13 @@ } deriving (Show, Eq) -packDocuments :: [FileHunk] -> BSL.ByteString-packDocuments docs =- BSL.intercalate "\n" $- map- ( \t -> A.encode $- case t of- FhSearch x -> A.toJSON x- FhClassifications x -> A.toJSON x- FhFineTune x -> A.toJSON x- )- docs--instance ToMultipart Mem FileCreate where- toMultipart rfc =- MultipartData- [ Input "purpose" (fcPurpose rfc)- ]- [ FileData "file" "data.jsonl" "application/json" (packDocuments $ fcDocuments rfc)- ]- newtype FileId = FileId {unFileId :: T.Text} deriving (Show, Eq, ToJSON, FromJSON, ToHttpApiData) data File = File { fId :: FileId, fCreatedAt :: TimeStamp,+ fStatus :: T.Text, fPurpose :: T.Text } deriving (Show, Eq)@@ -309,8 +290,8 @@ $(deriveJSON (jsonOpts 2) ''OpenAIList) $(deriveJSON (jsonOpts 1) ''Engine)-$(deriveJSON (jsonOpts 2) ''TextCompletion) $(deriveJSON (jsonOpts 3) ''TextCompletionChoice)+$(deriveJSON (jsonOpts 2) ''TextCompletion) $(deriveJSON (jsonOpts 4) ''TextCompletionCreate) $(deriveJSON (jsonOpts 2) ''SearchResult) $(deriveJSON (jsonOpts 4) ''SearchResultCreate)@@ -326,3 +307,23 @@ $(deriveJSON (jsonOpts 2) ''SearchHunk) $(deriveJSON (jsonOpts 2) ''ClassificationHunk) $(deriveJSON (jsonOpts 3) ''FineTuneHunk)++packDocuments :: [FileHunk] -> BSL.ByteString+packDocuments docs =+ BSL.intercalate "\n" $+ map+ ( \t -> A.encode $+ case t of+ FhSearch x -> A.toJSON x+ FhClassifications x -> A.toJSON x+ FhFineTune x -> A.toJSON x+ )+ docs++instance ToMultipart Mem FileCreate where+ toMultipart rfc =+ MultipartData+ [ Input "purpose" (fcPurpose rfc)+ ]+ [ FileData "file" "data.jsonl" "application/json" (packDocuments $ fcDocuments rfc)+ ]