Skip to content

feat: export createAxiosLanguageModel #94

Closed as not planned
Closed as not planned

Description

@abichinger

Exporting createAxiosLanguageModel would solve the following problems

  1. support custom axios config (e.g. users can pass a proxy)
    related: Support axios config #73 Add HTTP_PROXY variable and proxy process when access endpoints' api services #55 feat: add request config #34
  2. ability to pass custom parameters to the endpoint /v1/chat/completions

Activity

  1. DanielRosenwasser commented on Aug 9, 2023

    @DanielRosenwasser
    Member

    Personally I don't think the library should expose Axios at all, since it's an internal implementation detail.

    For example, in another issue someone asked about how to take advantage of streaming responses from OpenAI. Best I can tell, Axios doesn't make that easy to do (or it might not provide the APIs to do so at all). I use this as a specific example, but my point is really that hooking up Axios or whatever language model provider API is easy enough because TypeChatLanguageModel just needs a single function at the moment.

    Still, I'll let others weigh in here.

  2. snewell92 commented on Aug 11, 2023

    @snewell92

    Daniel Rosenwasser (@DanielRosenwasser) thete are likely legit n/w level overrides desired, but middleware is likely the better way forward imo rather than anything axios/fetch/ky specific.

    I agree with exposing the model the way it is with the single function 👍

  3. Akimyou commented on Aug 14, 2023

    @Akimyou

    I don't think TypeChat needs to provide proxy settings, as it can support proxy access through higher-level configurations, such as proxychains4.

  4. moltar commented on Aug 15, 2023

    @moltar
    1. I think the package shall use undici as this will be the default client in the future Node versions
    2. If anything needs to be exposed, then I think FetchEsque types from trpc can be borrowed, which can adapt to any fetch implementation.
  5. robgruen commented on Oct 12, 2026

    @robgruen
    Contributor

    Closing as not planned: the current implementation is Fetch-based, so exporting an Axios-specific internal helper no longer fits the API.

    The current model API supports proxy configuration through public options and standard proxy environment variables. For a custom transport or provider-specific request parameters, use the documented custom language model interface. This provides an extension point without making Axios part of TypeChat's public API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    In DiscussionScope or design nuances need to be discussedSuggestionNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions