ai-for-java / openai4j Goto Github PK
View Code? Open in Web Editor NEWJava client library for OpenAI API
License: Apache License 2.0
Java client library for OpenAI API
License: Apache License 2.0
Is your feature request related to a problem? Please describe.
I want to use the audio API (https://platform.openai.com/docs/api-reference/audio) offered by OpenAI.
Describe the solution you'd like
Support the audio API and provide examples of usage.
Describe alternatives you've considered
An alternative might be to use https://github.com/TheoKanning/openai-java
Additional context
Support for speech, transcriptions and translations as per the OpenAI audio API.
Is your feature request related to a problem? Please describe.
It's impossible to store all types of messages and get their content
Describe the solution you'd like
A some sort of getStringContent()
method to the Message
interface which will return the content of any form of message, for the UserMessage
it'll return the content if the content is a string, otherwise if it's a Content
it'll return the text content or the image url
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.
This is one of my favorite OpenAI APIs and I'd love for it to have the new Assistant API with support for the Files API and the new models
Hello,
I'm trying to use our Azure OpenAI deployment using openai4j. Problem is, the tenant expects the API key within a header called "Ocp-Apim-Subscription-Key" and not "api-key" as it has been hardcoded in src/main/java/dev/ai4j/openai4j/ApiKeyHeaderInjector.java.
The MS documentation says we can change the headers' name, but it just won't work and always reply 401 to all requests. Only works if the header is called "Ocp-Apim-Subscription-Key":
https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions
Any recommended solutions, besides forking the code and making the change in this file :) ? Thanks in advance !
Juan
trying out v13 and get retrofit2 error
Caused by: java.lang.NoClassDefFoundError: retrofit2.Converter$Factory at dev.ai4j.openai4j.OpenAiClient.builder(OpenAiClient.java:54) at
I'd love for it to have the new Retrieve assistant API
Is your feature request related to a problem? Please describe.
It looks like there is no way to list the models.
See https://platform.openai.com/docs/api-reference/models
Describe the solution you'd like
I would like a listModels() method that returns all the models.
Describe alternatives you've considered
I can get it myself using any HTTP client, but it breaks the experience of working with a Java library that wraps an API.
The other alternative is of course to use another library :-)
Additional context
btw, the terminology of openai4j, which uses Model
to describe its domain objects: ChatCompletionModel
, ImageCompletionModel
, etc is confusing when dealing with language models. Ideally , there shouldn't be overloading of the term Model
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.