File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/kotlin/com/cjcrafter/openai Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class OpenAI @JvmOverloads constructor(
64
64
val json = gson.toJson(request)
65
65
val body: RequestBody = json.toRequestBody(mediaType)
66
66
return Request .Builder ()
67
- .url(" https://api.openai.com/v1/ $endpoint " )
67
+ .url(" https://api.openai.com/$endpoint " )
68
68
.addHeader(" Content-Type" , " application/json" )
69
69
.addHeader(" Authorization" , " Bearer $apiKey " )
70
70
.apply { if (organization != null ) addHeader(" OpenAI-Organization" , organization) }
@@ -386,8 +386,11 @@ class OpenAI @JvmOverloads constructor(
386
386
387
387
companion object {
388
388
389
- const val COMPLETIONS_ENDPOINT = " completions"
390
- const val CHAT_ENDPOINT = " chat/completions"
389
+ const val COMPLETIONS_ENDPOINT = " v1/completions"
390
+ const val CHAT_ENDPOINT = " v1/chat/completions"
391
+ const val IMAGE_CREATE_ENDPOINT = " v1/images/generations"
392
+ const val IMAGE_EDIT_ENDPOINT = " v1/images/edits"
393
+ const val IMAGE_VARIATION_ENDPOINT = " v1/images/variations"
391
394
392
395
/* *
393
396
* Returns a `Gson` object that can be used to read/write .json files.
You can’t perform that action at this time.
0 commit comments