Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove responseFormat parameter until future notice #40

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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