ai-for-java / openai4j

Java client library for OpenAI API
Apache License 2.0
85 stars 34 forks source link

Add organizationId #7

Closed edeandrea closed 11 months ago

edeandrea commented 11 months ago

Allow the organizationId to be specified in the configuration. See https://platform.openai.com/docs/api-reference/organization-optional

Right now there is no way to specify this.

Since this is also a header, I introduced a new GenericHeaderInjector and then also refactored ApiKeyHeaderInjector and AuthorizationHeaderInjector to use it. I didn't eliminate ApiKeyHeaderInjector and AuthorizationHeaderInjector because that would have been a breaking change.

I also added a few things to .gitignore that I noticed were added when I loaded the project into IntelliJ and ran a build locally.

Fixes #6

edeandrea commented 11 months ago

Thanks for the comment @Heezer ! I've resolved the conflicts.

edeandrea commented 11 months ago

Once this is released I'll incorporate it into https://github.com/langchain4j/langchain4j/issues/344

ai-for-java commented 11 months ago

HI @edeandrea thanks for this! BTW why removing ApiKeyHeaderInjector would be a breaking change?

edeandrea commented 11 months ago

Oh I guess it wouldn't be because it's not public. Just realized that now.