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

Add ability to specify user in OpenAI and ChatOpenAI #143

Closed
mirkancal opened this issue Aug 31, 2023 · 2 comments · Fixed by #147
Closed

Add ability to specify user in OpenAI and ChatOpenAI #143

mirkancal opened this issue Aug 31, 2023 · 2 comments · Fixed by #147
Assignees
Labels
c:chat-models Chat models. c:llms Models and integrations. t:enhancement New feature or request
Milestone

Comments

@mirkancal
Copy link
Contributor

mirkancal commented Aug 31, 2023

Feature request

https://platform.openai.com/docs/guides/safety-best-practices

It seems missing.

Motivation

We can pass userId to OpenAI, not sure if there's any benefits except for them to monitor users.

Your contribution

Checking how to add without breaking the code.

@mirkancal mirkancal added the t:enhancement New feature or request label Aug 31, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in LangChain.dart Aug 31, 2023
@davidmigloz
Copy link
Owner

thanks for reporting @mirkancal!
Let me take a quick look. It should be easy to add.

@davidmigloz davidmigloz self-assigned this Aug 31, 2023
@davidmigloz davidmigloz added this to the v0.0.11 milestone Aug 31, 2023
@davidmigloz davidmigloz added c:llms Models and integrations. c:chat-models Chat models. labels Aug 31, 2023
@davidmigloz davidmigloz moved this from 📋 Backlog to 🏗 In Progress in LangChain.dart Aug 31, 2023
@davidmigloz davidmigloz changed the title Add User to the OpenAI endpoints Add ability to specify user in OpenAI and ChatOpenAI Aug 31, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in LangChain.dart Aug 31, 2023
@davidmigloz
Copy link
Owner

Done!

Now you can either specify it when instantiating the wrapper if the user will be always the same:

final chat = ChatOpenAI(
  apiKey: '...', 
  user: 'user123456',
);

Or when calling the llm if the user varies per request:

final res = await chat(
  [query],
  options: const ChatOpenAIOptions(user: 'user123456'),
);

Btw, thank you very much for assisting people in our discord, I really appreciate it 🙂

KennethKnudsen97 pushed a commit to KennethKnudsen97/langchain_dart that referenced this issue Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:chat-models Chat models. c:llms Models and integrations. t:enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants