Skip to content

Commit d7e66f6

Browse files
Add transform and latest stainless config from monorepo
1 parent 4d3fc52 commit d7e66f6

File tree

2 files changed

+74
-2
lines changed

2 files changed

+74
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 88
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-82fd6fcb3eea81cbbe09a6f831c82219f1251e1b76474b4c41f424bf277e6a71.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-79dcb0ae501ac17004f50aecb112a798290ab3727fbe7c7d1b34299e38ed4f8e.yml
33
openapi_spec_hash: c8d54bd1ae3d704f6b6f72ffd2f876d8
4-
config_hash: 3315d58b60faf63b1bee251b81837cda
4+
config_hash: 167ad0ca036d0f023c78e6496b4311e8

openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionCreateParams.kt

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,39 @@ private constructor(
813813
/** Alias for calling [addMessage] with `assistant.toParam()`. */
814814
fun addMessage(assistant: ChatCompletionMessage) = apply { body.addMessage(assistant) }
815815

816+
/**
817+
* Alias for calling [addMessage] with the following:
818+
* ```java
819+
* ChatCompletionAssistantMessageParam.builder()
820+
* .content(content)
821+
* .build()
822+
* ```
823+
*/
824+
fun addAssistantMessage(content: ChatCompletionAssistantMessageParam.Content?) = apply {
825+
body.addAssistantMessage(content)
826+
}
827+
828+
/** Alias for calling [addAssistantMessage] with `content.orElse(null)`. */
829+
fun addAssistantMessage(content: Optional<ChatCompletionAssistantMessageParam.Content>) =
830+
addAssistantMessage(content.getOrNull())
831+
832+
/**
833+
* Alias for calling [addAssistantMessage] with
834+
* `ChatCompletionAssistantMessageParam.Content.ofText(text)`.
835+
*/
836+
fun addAssistantMessage(text: String) = apply { body.addAssistantMessage(text) }
837+
838+
/**
839+
* Alias for calling [addAssistantMessage] with
840+
* `ChatCompletionAssistantMessageParam.Content.ofArrayOfContentParts(arrayOfContentParts)`.
841+
*/
842+
fun addAssistantMessageOfArrayOfContentParts(
843+
arrayOfContentParts:
844+
List<
845+
ChatCompletionAssistantMessageParam.Content.ChatCompletionRequestAssistantMessageContentPart
846+
>
847+
) = apply { body.addAssistantMessageOfArrayOfContentParts(arrayOfContentParts) }
848+
816849
/** Alias for calling [addMessage] with `ChatCompletionMessageParam.ofTool(tool)`. */
817850
fun addMessage(tool: ChatCompletionToolMessageParam) = apply { body.addMessage(tool) }
818851

@@ -2816,6 +2849,45 @@ private constructor(
28162849
/** Alias for calling [addMessage] with `assistant.toParam()`. */
28172850
fun addMessage(assistant: ChatCompletionMessage) = addMessage(assistant.toParam())
28182851

2852+
/**
2853+
* Alias for calling [addMessage] with the following:
2854+
* ```java
2855+
* ChatCompletionAssistantMessageParam.builder()
2856+
* .content(content)
2857+
* .build()
2858+
* ```
2859+
*/
2860+
fun addAssistantMessage(content: ChatCompletionAssistantMessageParam.Content?) =
2861+
addMessage(ChatCompletionAssistantMessageParam.builder().content(content).build())
2862+
2863+
/** Alias for calling [addAssistantMessage] with `content.orElse(null)`. */
2864+
fun addAssistantMessage(
2865+
content: Optional<ChatCompletionAssistantMessageParam.Content>
2866+
) = addAssistantMessage(content.getOrNull())
2867+
2868+
/**
2869+
* Alias for calling [addAssistantMessage] with
2870+
* `ChatCompletionAssistantMessageParam.Content.ofText(text)`.
2871+
*/
2872+
fun addAssistantMessage(text: String) =
2873+
addAssistantMessage(ChatCompletionAssistantMessageParam.Content.ofText(text))
2874+
2875+
/**
2876+
* Alias for calling [addAssistantMessage] with
2877+
* `ChatCompletionAssistantMessageParam.Content.ofArrayOfContentParts(arrayOfContentParts)`.
2878+
*/
2879+
fun addAssistantMessageOfArrayOfContentParts(
2880+
arrayOfContentParts:
2881+
List<
2882+
ChatCompletionAssistantMessageParam.Content.ChatCompletionRequestAssistantMessageContentPart
2883+
>
2884+
) =
2885+
addAssistantMessage(
2886+
ChatCompletionAssistantMessageParam.Content.ofArrayOfContentParts(
2887+
arrayOfContentParts
2888+
)
2889+
)
2890+
28192891
/** Alias for calling [addMessage] with `ChatCompletionMessageParam.ofTool(tool)`. */
28202892
fun addMessage(tool: ChatCompletionToolMessageParam) =
28212893
addMessage(ChatCompletionMessageParam.ofTool(tool))

0 commit comments

Comments
 (0)