Record Class ApiCredentials
java.lang.Object
java.lang.Record
bg.codexio.ai.openai.api.payload.credentials.ApiCredentials
- Record Components:
apiKey- generated in OpenAI user settings pageorganization- optional organization, default organization can be configured in OpenAI user settings pagebaseUrl- optional base url for the API calls, default one is https://api.openai.com/v1
This configuration is used to define the credentials used for auth in the
OpenAI API
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionApiCredentials(String apiKey) Generates credential object with supplied apiKey, default base url and empty organizationApiCredentials(String apiKey, String organization, String baseUrl) Creates an instance of aApiCredentialsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapiKey()Returns the value of theapiKeyrecord component.baseUrl()Returns the value of thebaseUrlrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theorganizationrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
BASE_URL
- See Also:
-
-
Constructor Details
-
ApiCredentials
Generates credential object with supplied apiKey, default base url and empty organization- Parameters:
apiKey- generated in OpenAI user settings page
-
ApiCredentials
Creates an instance of aApiCredentialsrecord class.- Parameters:
apiKey- the value for theapiKeyrecord componentorganization- the value for theorganizationrecord componentbaseUrl- the value for thebaseUrlrecord component
-
-
Method Details
-
baseUrl
Returns the value of thebaseUrlrecord component.- Returns:
- the value of the
baseUrlrecord component
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
apiKey
Returns the value of theapiKeyrecord component.- Returns:
- the value of the
apiKeyrecord component
-
organization
Returns the value of theorganizationrecord component.- Returns:
- the value of the
organizationrecord component
-