Skip to content

Commit

Permalink
Merge pull request #40 from imclerran/remove-response-format
Browse files Browse the repository at this point in the history
Remove responseFormat parameter until future notice
  • Loading branch information
imclerran authored Jan 3, 2025
2 parents a0f1b8c + 0e93ecc commit 644a511
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 0 additions & 2 deletions package/Chat.roc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ ChatRequestBody : {
provider : {
order : Option (List Str),
},
responseFormat : { type : Str },
models : Option (List Str),
route : Option Str,
# tools: Option (List Tools.Tool),
Expand Down Expand Up @@ -181,7 +180,6 @@ buildRequestBody = \client -> {
seed: client.seed,
maxTokens: client.maxTokens,
provider: { order: client.providerOrder },
responseFormat: client.responseFormat,
models: client.models,
route: client.route,
}
Expand Down
16 changes: 6 additions & 10 deletions package/Client.roc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module [
setTopA,
setSeed,
setMaxTokens,
setResponseFormat,
setModels,
setRoute,
setTools,
Expand Down Expand Up @@ -46,7 +45,6 @@ import InternalTools exposing [Tool]
## topA : F32,
## seed : Option U64,
## maxTokens : Option U64,
## responseFormat : { type : Str },
## models : Option (List Str),
## route : Option Str,
## tools: Option (List Tool),
Expand All @@ -68,7 +66,7 @@ Client : {
topA : F32,
seed : Option U64,
maxTokens : Option U64,
responseFormat : { type : Str },
# responseFormat : { type : Str },
models : Option (List Str),
route : Option Str,
tools: Option (List Tool),
Expand Down Expand Up @@ -101,13 +99,12 @@ init :
topA ? F32,
seed ? U64,
maxTokens ? U64,
responseFormat ? Str,
models ? List Str,
route ? [UseFallback, NoFallback],
tools ? List Tool,
}
-> Client
init = \{ apiKey, model ? defaultModel, url ? defaultUrl, requestTimeout ? NoTimeout, providerOrder ? [], temperature ? 1.0, topP ? 1.0, topK ? 0, frequencyPenalty ? 0.0, presencePenalty ? 0.0, repetitionPenalty ? 1.0, minP ? 0.0, topA ? 0.0, seed ? 0, maxTokens ? 0, responseFormat ? "text", models ? [], route ? NoFallback, tools ? [] } ->
init = \{ apiKey, model ? defaultModel, url ? defaultUrl, requestTimeout ? NoTimeout, providerOrder ? [], temperature ? 1.0, topP ? 1.0, topK ? 0, frequencyPenalty ? 0.0, presencePenalty ? 0.0, repetitionPenalty ? 1.0, minP ? 0.0, topA ? 0.0, seed ? 0, maxTokens ? 0, models ? [], route ? NoFallback, tools ? [] } ->
{
apiKey,
model,
Expand All @@ -124,7 +121,6 @@ init = \{ apiKey, model ? defaultModel, url ? defaultUrl, requestTimeout ? NoTim
topA,
seed: Option.none {},
maxTokens: Option.none {},
responseFormat: { type: responseFormat },
models: Option.none {},
route: Option.none {},
tools: Option.none {},
Expand Down Expand Up @@ -231,10 +227,10 @@ setMaxTokens = \client, maxTokens ->

## Set the response format to either "text" or "json_object". Not supported by all models.
## Default: "" - no format
setResponseFormat : Client, Str -> Client
setResponseFormat = \client, responseFormat ->
responseFormatRecord = { type: responseFormat }
{ client & responseFormat: responseFormatRecord }
# setResponseFormat : Client, Str -> Client
# setResponseFormat = \client, responseFormat ->
# responseFormatRecord = { type: responseFormat }
# { client & responseFormat: responseFormatRecord }

## Set the models for the auto router to choose from. If not set, the auto router will choose from a small selection of the top performing models.
## https://openrouter.ai/models/openrouter/auto
Expand Down
2 changes: 0 additions & 2 deletions package/Prompt.roc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ PromptRequestBody : {
provider : {
order : Option (List Str),
},
responseFormat : { type : Str },
models : Option (List Str),
route : Option Str,
}
Expand Down Expand Up @@ -96,7 +95,6 @@ buildRequestBody = \client, prompt -> {
seed: client.seed,
maxTokens: client.maxTokens,
provider: { order: client.providerOrder },
responseFormat: client.responseFormat,
models: client.models,
route: client.route,
}
Expand Down

0 comments on commit 644a511

Please sign in to comment.