Skip to content

Broken Config definition for openai-compat LanguageModel #2437

Description

@aedrondouren

What version of Effect is running?

4.0.0-beta.84

What steps can reproduce the bug?

import { OpenAiLanguageModel } from '@effect/ai-openai-compat';

const model = OpenAiLanguageModel.model('<MODEL>', { });
//         No auto-completion when providing config ^

What is the expected behavior?

Auto-completion when providing default fields like temperature, top_p and reasoning.

What do you see instead?

Auto-completion with every known symbol in the project.

Additional information

export class Config extends Context.Service<
  Config,
  Simplify<
    & Partial<
      Omit<
        CreateResponse,
        "input" | "tools" | "tool_choice" | "stream" | "text"
      >
    >
    & {
      readonly fileIdPrefixes?: ReadonlyArray<string> | undefined
      readonly text?: {
        readonly verbosity?: "low" | "medium" | "high" | undefined
      } | undefined
      readonly strictJsonSchema?: boolean | undefined
      readonly [x: string]: unknown
    }
  >
>()("@effect/ai-openai-compat/OpenAiLanguageModel/Config") {}

The readonly [x: string]: unknown key breaks auto-completion. Removing it solves the issue, but I assume this was added to allow custom fields for other OpenAI compatible model providers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions