Skip to content

Commit

Permalink
docs: add some missing javadocs (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jan 3, 2025
1 parent bc9974b commit 49a9056
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,13 @@ constructor(
)
}

/**
* System prompt.
*
* A system prompt is a way of providing context and instructions to Claude, such as
* specifying a particular goal or role. See our
* [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
*/
@JsonDeserialize(using = System.Deserializer::class)
@JsonSerialize(using = System.Serializer::class)
class System
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/**
* Processing result for this request.
*
* Contains a Message output if processing was successful, an error response if processing failed,
* or the reason why processing was not attempted, such as cancellation or expiration.
*/
@JsonDeserialize(using = BetaMessageBatchResult.Deserializer::class)
@JsonSerialize(using = BetaMessageBatchResult.Serializer::class)
class BetaMessageBatchResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,13 @@ constructor(
)
}

/**
* System prompt.
*
* A system prompt is a way of providing context and instructions to Claude, such as specifying
* a particular goal or role. See our
* [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
*/
@JsonDeserialize(using = System.Deserializer::class)
@JsonSerialize(using = System.Serializer::class)
class System
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,13 @@ constructor(
)
}

/**
* System prompt.
*
* A system prompt is a way of providing context and instructions to Claude, such as specifying
* a particular goal or role. See our
* [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
*/
@JsonDeserialize(using = System.Deserializer::class)
@JsonSerialize(using = System.Serializer::class)
class System
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/**
* How the model should use the provided tools. The model can use a specific tool, any available
* tool, or decide by itself.
*/
@JsonDeserialize(using = BetaToolChoice.Deserializer::class)
@JsonSerialize(using = BetaToolChoice.Serializer::class)
class BetaToolChoice
Expand All @@ -43,11 +47,12 @@ private constructor(

fun isBetaToolChoiceTool(): Boolean = betaToolChoiceTool != null

/** The model will automatically decide whether to use tools. */
fun asBetaToolChoiceAuto(): BetaToolChoiceAuto =
betaToolChoiceAuto.getOrThrow("betaToolChoiceAuto")

/** The model will use any available tools. */
fun asBetaToolChoiceAny(): BetaToolChoiceAny = betaToolChoiceAny.getOrThrow("betaToolChoiceAny")

/** The model will use the specified tool with `tool_choice.name`. */
fun asBetaToolChoiceTool(): BetaToolChoiceTool =
betaToolChoiceTool.getOrThrow("betaToolChoiceTool")

Expand Down Expand Up @@ -99,14 +104,17 @@ private constructor(

companion object {

/** The model will automatically decide whether to use tools. */
@JvmStatic
fun ofBetaToolChoiceAuto(betaToolChoiceAuto: BetaToolChoiceAuto) =
BetaToolChoice(betaToolChoiceAuto = betaToolChoiceAuto)

/** The model will use any available tools. */
@JvmStatic
fun ofBetaToolChoiceAny(betaToolChoiceAny: BetaToolChoiceAny) =
BetaToolChoice(betaToolChoiceAny = betaToolChoiceAny)

/** The model will use the specified tool with `tool_choice.name`. */
@JvmStatic
fun ofBetaToolChoiceTool(betaToolChoiceTool: BetaToolChoiceTool) =
BetaToolChoice(betaToolChoiceTool = betaToolChoiceTool)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,13 @@ constructor(
)
}

/**
* System prompt.
*
* A system prompt is a way of providing context and instructions to Claude, such as
* specifying a particular goal or role. See our
* [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
*/
@JsonDeserialize(using = System.Deserializer::class)
@JsonSerialize(using = System.Serializer::class)
class System
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/**
* Processing result for this request.
*
* Contains a Message output if processing was successful, an error response if processing failed,
* or the reason why processing was not attempted, such as cancellation or expiration.
*/
@JsonDeserialize(using = MessageBatchResult.Deserializer::class)
@JsonSerialize(using = MessageBatchResult.Serializer::class)
class MessageBatchResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,13 @@ constructor(
)
}

/**
* System prompt.
*
* A system prompt is a way of providing context and instructions to Claude, such as specifying
* a particular goal or role. See our
* [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
*/
@JsonDeserialize(using = System.Deserializer::class)
@JsonSerialize(using = System.Serializer::class)
class System
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,13 @@ constructor(
)
}

/**
* System prompt.
*
* A system prompt is a way of providing context and instructions to Claude, such as specifying
* a particular goal or role. See our
* [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
*/
@JsonDeserialize(using = System.Deserializer::class)
@JsonSerialize(using = System.Serializer::class)
class System
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/**
* How the model should use the provided tools. The model can use a specific tool, any available
* tool, or decide by itself.
*/
@JsonDeserialize(using = ToolChoice.Deserializer::class)
@JsonSerialize(using = ToolChoice.Serializer::class)
class ToolChoice
Expand All @@ -43,10 +47,11 @@ private constructor(

fun isToolChoiceTool(): Boolean = toolChoiceTool != null

/** The model will automatically decide whether to use tools. */
fun asToolChoiceAuto(): ToolChoiceAuto = toolChoiceAuto.getOrThrow("toolChoiceAuto")

/** The model will use any available tools. */
fun asToolChoiceAny(): ToolChoiceAny = toolChoiceAny.getOrThrow("toolChoiceAny")

/** The model will use the specified tool with `tool_choice.name`. */
fun asToolChoiceTool(): ToolChoiceTool = toolChoiceTool.getOrThrow("toolChoiceTool")

fun _json(): Optional<JsonValue> = Optional.ofNullable(_json)
Expand Down Expand Up @@ -93,14 +98,17 @@ private constructor(

companion object {

/** The model will automatically decide whether to use tools. */
@JvmStatic
fun ofToolChoiceAuto(toolChoiceAuto: ToolChoiceAuto) =
ToolChoice(toolChoiceAuto = toolChoiceAuto)

/** The model will use any available tools. */
@JvmStatic
fun ofToolChoiceAny(toolChoiceAny: ToolChoiceAny) =
ToolChoice(toolChoiceAny = toolChoiceAny)

/** The model will use the specified tool with `tool_choice.name`. */
@JvmStatic
fun ofToolChoiceTool(toolChoiceTool: ToolChoiceTool) =
ToolChoice(toolChoiceTool = toolChoiceTool)
Expand Down

0 comments on commit 49a9056

Please sign in to comment.