Skip to content

Model settings loaded from env are passed as strings, causing 400 errors (seed / temperature) #16

@Samk1710

Description

@Samk1710

OPENAI_TEMPERATURE = os.getenv("OPENAI_TEMPERATURE", 0.3)

OPENAI_MODEL_SEED = os.getenv("OPENAI_MODEL_SEED", 11111111)

os.getenv() always returns strings(), even when the default is numeric. When values come from .env they remain as strings and are passed directly into OpenAIChatModelSettings.

In my local run,I ran into the following errors:

Using Ollama,

json: cannot unmarshal string into Go struct field ChatCompletionRequest.seed of type int

Using GPT,

Invalid type for 'temperature': expected a decimal, but got a string instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions