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

[nice-to-have] Add Kotlin DSL builders alongside Java builders #70

Open
gad2103 opened this issue Dec 30, 2024 · 3 comments
Open

[nice-to-have] Add Kotlin DSL builders alongside Java builders #70

gad2103 opened this issue Dec 30, 2024 · 3 comments

Comments

@gad2103
Copy link

gad2103 commented Dec 30, 2024

My company uses Kotlin server side and it would be nice to have Kotlin DSL builders for the all the objects herein. Happy to help contribute on this if you are looking for some contributors.

@TomerAberbach
Copy link
Collaborator

Hey @gad2103!

We actually have plans to eventually release a Kotlin specific package (openai-kotlin) where the public API is specifically tailored for Kotlin. For example, openai-kotlin would have:

  • Nullable return types instead of optionals
  • Computed properties instead of getter methods
  • Kotlin-friendly builders :)

For the builders, we were thinking something like this:

val params = ChatCompletionCreateParams {
  messages(/* ... */) 
  // OR
  userMessage {
    // ...
  }
  assistantMessage {
    // ...
  }
  // More messages...

  model(ChatModel.O1)
  // More properties...
}

Does that look like roughly what you wanted?

@nathanfallet
Copy link

Any ETA for the kotlin specific package? (it's based on the java one, only adding extensions)

@TomerAberbach
Copy link
Collaborator

Any ETA for the kotlin specific package? (it's based on the java one, only adding extensions)

We can't make any firm commitments right now, but we'd hope to ship a Kotlin package within a month or two of GA'ing this Java one.

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

No branches or pull requests

3 participants