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

feat: export createAxiosLanguageModel #94

Open
abichinger opened this issue Aug 4, 2023 · 4 comments
Open

feat: export createAxiosLanguageModel #94

abichinger opened this issue Aug 4, 2023 · 4 comments
Labels
In Discussion Scope or design nuances need to be discussed Suggestion New feature or request

Comments

@abichinger
Copy link

abichinger commented Aug 4, 2023

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
abichinger added a commit to abichinger/TypeChat that referenced this issue Aug 4, 2023
@DanielRosenwasser DanielRosenwasser added Suggestion New feature or request In Discussion Scope or design nuances need to be discussed labels Aug 9, 2023
@DanielRosenwasser
Copy link
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.

@snewell92
Copy link

@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 👍

@Akimyou
Copy link

Akimyou commented Aug 14, 2023

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

@moltar
Copy link

moltar commented Aug 15, 2023

  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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Discussion Scope or design nuances need to be discussed Suggestion New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants