Skip to content

Commit 8f0299e

Browse files
chore(internal): change some comment formatting
1 parent 6fd22e2 commit 8f0299e

File tree

9 files changed

+284
-356
lines changed

9 files changed

+284
-356
lines changed

anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaMessage.kt

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private constructor(
101101
*
102102
* Example:
103103
* ```json
104-
* [{ "type": "text", "text": "Hi, I'm Claude." }]
104+
* [{"type": "text", "text": "Hi, I'm Claude."}]
105105
* ```
106106
*
107107
* If the request input `messages` ended with an `assistant` turn, then the response `content`
@@ -110,17 +110,14 @@ private constructor(
110110
* For example, if the input `messages` were:
111111
* ```json
112112
* [
113-
* {
114-
* "role": "user",
115-
* "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
116-
* },
117-
* { "role": "assistant", "content": "The best answer is (" }
113+
* {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
114+
* {"role": "assistant", "content": "The best answer is ("}
118115
* ]
119116
* ```
120117
*
121118
* Then the response `content` might be:
122119
* ```json
123-
* [{ "type": "text", "text": "B)" }]
120+
* [{"type": "text", "text": "B)"}]
124121
* ```
125122
*
126123
* @throws AnthropicInvalidDataException if the JSON field has an unexpected type or is
@@ -157,13 +154,13 @@ private constructor(
157154
* The reason that we stopped.
158155
*
159156
* This may be one the following values:
160-
* - `"end_turn"`: the model reached a natural stopping point
161-
* - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
162-
* - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
163-
* - `"tool_use"`: the model invoked one or more tools
164-
* - `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a
157+
* * `"end_turn"`: the model reached a natural stopping point
158+
* * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
159+
* * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
160+
* * `"tool_use"`: the model invoked one or more tools
161+
* * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a
165162
* subsequent request to let the model continue.
166-
* - `"refusal"`: when streaming classifiers intervene to handle potential policy violations
163+
* * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
167164
*
168165
* In non-streaming mode this value is always non-null. In streaming mode, it is null in the
169166
* `message_start` event and non-null otherwise.
@@ -372,7 +369,7 @@ private constructor(
372369
*
373370
* Example:
374371
* ```json
375-
* [{ "type": "text", "text": "Hi, I'm Claude." }]
372+
* [{"type": "text", "text": "Hi, I'm Claude."}]
376373
* ```
377374
*
378375
* If the request input `messages` ended with an `assistant` turn, then the response
@@ -382,17 +379,14 @@ private constructor(
382379
* For example, if the input `messages` were:
383380
* ```json
384381
* [
385-
* {
386-
* "role": "user",
387-
* "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
388-
* },
389-
* { "role": "assistant", "content": "The best answer is (" }
382+
* {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
383+
* {"role": "assistant", "content": "The best answer is ("}
390384
* ]
391385
* ```
392386
*
393387
* Then the response `content` might be:
394388
* ```json
395-
* [{ "type": "text", "text": "B)" }]
389+
* [{"type": "text", "text": "B)"}]
396390
* ```
397391
*/
398392
fun content(content: List<BetaContentBlock>) = content(JsonField.of(content))
@@ -564,13 +558,13 @@ private constructor(
564558
* The reason that we stopped.
565559
*
566560
* This may be one the following values:
567-
* - `"end_turn"`: the model reached a natural stopping point
568-
* - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
569-
* - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
570-
* - `"tool_use"`: the model invoked one or more tools
571-
* - `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is
561+
* * `"end_turn"`: the model reached a natural stopping point
562+
* * `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
563+
* * `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
564+
* * `"tool_use"`: the model invoked one or more tools
565+
* * `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is
572566
* in a subsequent request to let the model continue.
573-
* - `"refusal"`: when streaming classifiers intervene to handle potential policy violations
567+
* * `"refusal"`: when streaming classifiers intervene to handle potential policy violations
574568
*
575569
* In non-streaming mode this value is always non-null. In streaming mode, it is null in the
576570
* `message_start` event and non-null otherwise.

anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/MessageCountTokensParams.kt

Lines changed: 48 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -71,37 +71,34 @@ private constructor(
7171
*
7272
* Example with a single `user` message:
7373
* ```json
74-
* [{ "role": "user", "content": "Hello, Claude" }]
74+
* [{"role": "user", "content": "Hello, Claude"}]
7575
* ```
7676
*
7777
* Example with multiple conversational turns:
7878
* ```json
7979
* [
80-
* { "role": "user", "content": "Hello there." },
81-
* { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
82-
* { "role": "user", "content": "Can you explain LLMs in plain English?" }
80+
* {"role": "user", "content": "Hello there."},
81+
* {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
82+
* {"role": "user", "content": "Can you explain LLMs in plain English?"},
8383
* ]
8484
* ```
8585
*
8686
* Example with a partially-filled response from Claude:
8787
* ```json
8888
* [
89-
* {
90-
* "role": "user",
91-
* "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
92-
* },
93-
* { "role": "assistant", "content": "The best answer is (" }
89+
* {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
90+
* {"role": "assistant", "content": "The best answer is ("},
9491
* ]
9592
* ```
9693
*
9794
* Each input message `content` may be either a single `string` or an array of content blocks,
9895
* where each block has a specific `type`. Using a `string` for `content` is shorthand for an
9996
* array of one content block of type `"text"`. The following input messages are equivalent:
10097
* ```json
101-
* { "role": "user", "content": "Hello, Claude" }
98+
* {"role": "user", "content": "Hello, Claude"}
10299
* ```
103100
* ```json
104-
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
101+
* {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
105102
* ```
106103
*
107104
* See [input examples](https://docs.anthropic.com/en/api/messages-examples).
@@ -182,14 +179,14 @@ private constructor(
182179
*
183180
* There are two types of tools: **client tools** and **server tools**. The behavior described
184181
* below applies to client tools. For
185-
* [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
182+
* [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview\#server-tools),
186183
* see their individual documentation as each has its own behavior (e.g., the
187184
* [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
188185
*
189186
* Each tool definition includes:
190-
* - `name`: Name of the tool.
191-
* - `description`: Optional, but strongly-recommended description of the tool.
192-
* - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input`
187+
* * `name`: Name of the tool.
188+
* * `description`: Optional, but strongly-recommended description of the tool.
189+
* * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input`
193190
* shape that the model will produce in `tool_use` output content blocks.
194191
*
195192
* For example, if you defined `tools` as:
@@ -392,26 +389,23 @@ private constructor(
392389
*
393390
* Example with a single `user` message:
394391
* ```json
395-
* [{ "role": "user", "content": "Hello, Claude" }]
392+
* [{"role": "user", "content": "Hello, Claude"}]
396393
* ```
397394
*
398395
* Example with multiple conversational turns:
399396
* ```json
400397
* [
401-
* { "role": "user", "content": "Hello there." },
402-
* { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
403-
* { "role": "user", "content": "Can you explain LLMs in plain English?" }
398+
* {"role": "user", "content": "Hello there."},
399+
* {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
400+
* {"role": "user", "content": "Can you explain LLMs in plain English?"},
404401
* ]
405402
* ```
406403
*
407404
* Example with a partially-filled response from Claude:
408405
* ```json
409406
* [
410-
* {
411-
* "role": "user",
412-
* "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
413-
* },
414-
* { "role": "assistant", "content": "The best answer is (" }
407+
* {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
408+
* {"role": "assistant", "content": "The best answer is ("},
415409
* ]
416410
* ```
417411
*
@@ -420,10 +414,10 @@ private constructor(
420414
* shorthand for an array of one content block of type `"text"`. The following input
421415
* messages are equivalent:
422416
* ```json
423-
* { "role": "user", "content": "Hello, Claude" }
417+
* {"role": "user", "content": "Hello, Claude"}
424418
* ```
425419
* ```json
426-
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
420+
* {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
427421
* ```
428422
*
429423
* See [input examples](https://docs.anthropic.com/en/api/messages-examples).
@@ -670,14 +664,14 @@ private constructor(
670664
*
671665
* There are two types of tools: **client tools** and **server tools**. The behavior
672666
* described below applies to client tools. For
673-
* [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
667+
* [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview\#server-tools),
674668
* see their individual documentation as each has its own behavior (e.g., the
675669
* [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
676670
*
677671
* Each tool definition includes:
678-
* - `name`: Name of the tool.
679-
* - `description`: Optional, but strongly-recommended description of the tool.
680-
* - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool
672+
* * `name`: Name of the tool.
673+
* * `description`: Optional, but strongly-recommended description of the tool.
674+
* * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool
681675
* `input` shape that the model will produce in `tool_use` output content blocks.
682676
*
683677
* For example, if you defined `tools` as:
@@ -1042,26 +1036,23 @@ private constructor(
10421036
*
10431037
* Example with a single `user` message:
10441038
* ```json
1045-
* [{ "role": "user", "content": "Hello, Claude" }]
1039+
* [{"role": "user", "content": "Hello, Claude"}]
10461040
* ```
10471041
*
10481042
* Example with multiple conversational turns:
10491043
* ```json
10501044
* [
1051-
* { "role": "user", "content": "Hello there." },
1052-
* { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
1053-
* { "role": "user", "content": "Can you explain LLMs in plain English?" }
1045+
* {"role": "user", "content": "Hello there."},
1046+
* {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
1047+
* {"role": "user", "content": "Can you explain LLMs in plain English?"},
10541048
* ]
10551049
* ```
10561050
*
10571051
* Example with a partially-filled response from Claude:
10581052
* ```json
10591053
* [
1060-
* {
1061-
* "role": "user",
1062-
* "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
1063-
* },
1064-
* { "role": "assistant", "content": "The best answer is (" }
1054+
* {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
1055+
* {"role": "assistant", "content": "The best answer is ("},
10651056
* ]
10661057
* ```
10671058
*
@@ -1070,10 +1061,10 @@ private constructor(
10701061
* shorthand for an array of one content block of type `"text"`. The following input
10711062
* messages are equivalent:
10721063
* ```json
1073-
* { "role": "user", "content": "Hello, Claude" }
1064+
* {"role": "user", "content": "Hello, Claude"}
10741065
* ```
10751066
* ```json
1076-
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
1067+
* {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
10771068
* ```
10781069
*
10791070
* See [input examples](https://docs.anthropic.com/en/api/messages-examples).
@@ -1156,14 +1147,14 @@ private constructor(
11561147
*
11571148
* There are two types of tools: **client tools** and **server tools**. The behavior
11581149
* described below applies to client tools. For
1159-
* [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
1150+
* [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview\#server-tools),
11601151
* see their individual documentation as each has its own behavior (e.g., the
11611152
* [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
11621153
*
11631154
* Each tool definition includes:
1164-
* - `name`: Name of the tool.
1165-
* - `description`: Optional, but strongly-recommended description of the tool.
1166-
* - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool
1155+
* * `name`: Name of the tool.
1156+
* * `description`: Optional, but strongly-recommended description of the tool.
1157+
* * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool
11671158
* `input` shape that the model will produce in `tool_use` output content blocks.
11681159
*
11691160
* For example, if you defined `tools` as:
@@ -1349,26 +1340,23 @@ private constructor(
13491340
*
13501341
* Example with a single `user` message:
13511342
* ```json
1352-
* [{ "role": "user", "content": "Hello, Claude" }]
1343+
* [{"role": "user", "content": "Hello, Claude"}]
13531344
* ```
13541345
*
13551346
* Example with multiple conversational turns:
13561347
* ```json
13571348
* [
1358-
* { "role": "user", "content": "Hello there." },
1359-
* { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
1360-
* { "role": "user", "content": "Can you explain LLMs in plain English?" }
1349+
* {"role": "user", "content": "Hello there."},
1350+
* {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
1351+
* {"role": "user", "content": "Can you explain LLMs in plain English?"},
13611352
* ]
13621353
* ```
13631354
*
13641355
* Example with a partially-filled response from Claude:
13651356
* ```json
13661357
* [
1367-
* {
1368-
* "role": "user",
1369-
* "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
1370-
* },
1371-
* { "role": "assistant", "content": "The best answer is (" }
1358+
* {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
1359+
* {"role": "assistant", "content": "The best answer is ("},
13721360
* ]
13731361
* ```
13741362
*
@@ -1377,10 +1365,10 @@ private constructor(
13771365
* shorthand for an array of one content block of type `"text"`. The following input
13781366
* messages are equivalent:
13791367
* ```json
1380-
* { "role": "user", "content": "Hello, Claude" }
1368+
* {"role": "user", "content": "Hello, Claude"}
13811369
* ```
13821370
* ```json
1383-
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
1371+
* {"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
13841372
* ```
13851373
*
13861374
* See [input examples](https://docs.anthropic.com/en/api/messages-examples).
@@ -1661,14 +1649,14 @@ private constructor(
16611649
*
16621650
* There are two types of tools: **client tools** and **server tools**. The behavior
16631651
* described below applies to client tools. For
1664-
* [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
1652+
* [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview\#server-tools),
16651653
* see their individual documentation as each has its own behavior (e.g., the
16661654
* [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
16671655
*
16681656
* Each tool definition includes:
1669-
* - `name`: Name of the tool.
1670-
* - `description`: Optional, but strongly-recommended description of the tool.
1671-
* - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool
1657+
* * `name`: Name of the tool.
1658+
* * `description`: Optional, but strongly-recommended description of the tool.
1659+
* * `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool
16721660
* `input` shape that the model will produce in `tool_use` output content blocks.
16731661
*
16741662
* For example, if you defined `tools` as:

0 commit comments

Comments
 (0)