Skip to content

Commit

Permalink
Update Sources/SpeziLLMOpenAI/LLMOpenAISession+Configuration.swift
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Schmiedmayer <[email protected]>
  • Loading branch information
paulhdk and PSchmiedmayer authored Dec 21, 2024
1 parent 10fcb63 commit 37b2b60
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions Sources/SpeziLLMOpenAI/LLMOpenAISession+Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,29 @@ extension LLMOpenAISession {
}

return await Operations.createChatCompletion
.Input(body: .json(LLMOpenAIRequestType(
messages: openAIContext,
model: schema.parameters.modelType,
frequency_penalty: schema.modelParameters.frequencyPenalty,
logit_bias: schema.modelParameters.logitBias.additionalProperties.isEmpty ? nil : schema
.modelParameters
.logitBias,
max_tokens: schema.modelParameters.maxOutputLength,
n: schema.modelParameters.completionsPerOutput,
presence_penalty: schema.modelParameters.presencePenalty,
response_format: schema.modelParameters.responseFormat,
seed: schema.modelParameters.seed,
stop: LLMOpenAIRequestType.stopPayload.case2(schema.modelParameters.stopSequence),
stream: true,
temperature: schema.modelParameters.temperature,
top_p: schema.modelParameters.topP,
tools: functions.isEmpty ? nil : functions,
user: schema.modelParameters.user
)))
.Input(body:

Check failure on line 38 in Sources/SpeziLLMOpenAI/LLMOpenAISession+Configuration.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

Multiline Arguments Brackets Violation: Multiline arguments should have their surrounding brackets in a new line (multiline_arguments_brackets)

Check failure on line 38 in Sources/SpeziLLMOpenAI/LLMOpenAISession+Configuration.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
.json(
LLMOpenAIRequestType(
messages: openAIContext,
model: schema.parameters.modelType,
frequency_penalty: schema.modelParameters.frequencyPenalty,
logit_bias: schema.modelParameters.logitBias.additionalProperties.isEmpty ? nil : schema
.modelParameters
.logitBias,
max_tokens: schema.modelParameters.maxOutputLength,
n: schema.modelParameters.completionsPerOutput,
presence_penalty: schema.modelParameters.presencePenalty,
response_format: schema.modelParameters.responseFormat,
seed: schema.modelParameters.seed,
stop: LLMOpenAIRequestType.stopPayload.case2(schema.modelParameters.stopSequence),
stream: true,
temperature: schema.modelParameters.temperature,
top_p: schema.modelParameters.topP,
tools: functions.isEmpty ? nil : functions,
user: schema.modelParameters.user
)
)
)
}
}

Expand Down

0 comments on commit 37b2b60

Please sign in to comment.