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

Allow modificatons of completionParams via sendMessage #434

Closed
markNZed opened this issue Mar 5, 2023 · 5 comments · May be fixed by p4ndish/A2sv-Contest-Monitor-bot#31
Closed

Allow modificatons of completionParams via sendMessage #434

markNZed opened this issue Mar 5, 2023 · 5 comments · May be fixed by p4ndish/A2sv-Contest-Monitor-bot#31

Comments

@markNZed
Copy link

markNZed commented Mar 5, 2023

Describe the feature

For options like temperature it seems OpenAPI supports changing this per chatCompletion message. For example, on a server we might have one API instance the is sending messages for different clients with different temperature ?

@transitive-bullshit
Copy link
Owner

Makes sense and happy to accept a PR for this.

completionParams being part of the constructor is purely because of historical reasons as the package has gone through quite a few iterations.

Thanks!

@markNZed
Copy link
Author

markNZed commented Mar 6, 2023

How would you like the interface to look ? Would we add a public function for updating the params or add options to sendmessage ?

@transitive-bullshit
Copy link
Owner

Just adding it as an additional option to sendMessage opts and having it override the defaults like

const completionParams = { ...this._completionParams, ...opts.completionParams }

@transitive-bullshit
Copy link
Owner

@markNZed this is now supported in https://github.com/transitive-bullshit/chatgpt-api/releases/tag/v5.1.1 🔥

@markNZed
Copy link
Author

I finally got to testing this and ran into problems. Do we need to be able to dynamically set: maxResponseTokens and maxModelTokens. Is it possible to do this with the OpenAI API ? A minor issues was a change in the artialResponse.delta starting with special characters that no longer went through JSON.stringify(partialResponse.delta) but that is not a big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants