|
6 | 6 |
|
7 | 7 | ### Links |
8 | 8 |
|
9 | | -- [微信::觉学社::智能体软件工程 #3 |重新思考版本控制](https://mp.weixin.qq.com/s/-kZ-xyj_RZgCB7JgMkAeOw) |
| 9 | +- [微信==觉学社==智能体软件工程 #3 |重新思考版本控制](https://mp.weixin.qq.com/s/-kZ-xyj_RZgCB7JgMkAeOw) |
10 | 10 |
|
11 | 11 |
|
12 | 12 |
|
|
30 | 30 |
|
31 | 31 | ### Links |
32 | 32 |
|
33 | | -- [docs::official::agent-skills](https://agentskills.io/home) |
| 33 | +- [docs==official==agent-skills](https://agentskills.io/home) |
34 | 34 |
|
35 | 35 | ### what |
36 | 36 |
|
37 | 37 | - A skill is a set of instructions - packaged as a simple folder - that teaches Claude how to handle specific tasks or workflows. Skills are one of the most powerful ways to customize Claude for your specific needs. |
38 | 38 |
|
39 | 39 |
|
40 | 40 |
|
| 41 | +## gemini enterprise agent platform |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +### links |
| 46 | + |
| 47 | +- [**ntroducing Gemini Enterprise Agent Platform**](https://cloud.google.com/blog/products/ai-machine-learning/introducing-gemini-enterprise-agent-platform) |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +# API |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +## Chat Completions |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +## Responses API |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +## Messages API |
| 66 | + |
| 67 | +> links |
| 68 | +> |
| 69 | +> - [anthropic-sdk-typescript](https://github.com/anthropics/anthropic-sdk-typescript) |
| 70 | +
|
| 71 | +### Content |
| 72 | + |
| 73 | +https://github.com/anthropics/anthropic-sdk-typescript/blob/main/src/resources/messages/messages.ts |
| 74 | + |
| 75 | +```typescript |
| 76 | +export type ContentBlock = |
| 77 | + | TextBlock |
| 78 | + | ThinkingBlock |
| 79 | + | RedactedThinkingBlock |
| 80 | + | ToolUseBlock |
| 81 | + | ServerToolUseBlock |
| 82 | + | WebSearchToolResultBlock |
| 83 | + | WebFetchToolResultBlock |
| 84 | + | CodeExecutionToolResultBlock |
| 85 | + | BashCodeExecutionToolResultBlock |
| 86 | + | TextEditorCodeExecutionToolResultBlock |
| 87 | + | ToolSearchToolResultBlock |
| 88 | + | ContainerUploadBlock; |
| 89 | +``` |
| 90 | + |
| 91 | +### Message |
| 92 | + |
| 93 | +```typescript |
| 94 | +export interface Message { |
| 95 | + /** |
| 96 | + * Unique object identifier. |
| 97 | + * |
| 98 | + * The format and length of IDs may change over time. |
| 99 | + */ |
| 100 | + id: string; |
| 101 | + |
| 102 | + /** |
| 103 | + * Information about the container used in the request (for the code execution |
| 104 | + * tool) |
| 105 | + */ |
| 106 | + container: Container | null; |
| 107 | + |
| 108 | + /** |
| 109 | + * Content generated by the model. |
| 110 | + * |
| 111 | + * This is an array of content blocks, each of which has a `type` that determines |
| 112 | + * its shape. |
| 113 | + * |
| 114 | + * Example: |
| 115 | + * |
| 116 | + * ```json |
| 117 | + * [{ "type": "text", "text": "Hi, I'm Claude." }] |
| 118 | + * ``` |
| 119 | + * |
| 120 | + * If the request input `messages` ended with an `assistant` turn, then the |
| 121 | + * response `content` will continue directly from that last turn. You can use this |
| 122 | + * to constrain the model's output. |
| 123 | + * |
| 124 | + * For example, if the input `messages` were: |
| 125 | + * |
| 126 | + * ```json |
| 127 | + * [ |
| 128 | + * { |
| 129 | + * "role": "user", |
| 130 | + * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" |
| 131 | + * }, |
| 132 | + * { "role": "assistant", "content": "The best answer is (" } |
| 133 | + * ] |
| 134 | + * ``` |
| 135 | + * |
| 136 | + * Then the response `content` might be: |
| 137 | + * |
| 138 | + * ```json |
| 139 | + * [{ "type": "text", "text": "B)" }] |
| 140 | + * ``` |
| 141 | + */ |
| 142 | + content: Array<ContentBlock>; |
| 143 | + |
| 144 | + /** |
| 145 | + * The model that will complete your prompt. |
| 146 | + * |
| 147 | + * See [models](https://docs.anthropic.com/en/docs/models-overview) for additional |
| 148 | + * details and options. |
| 149 | + */ |
| 150 | + model: Model; |
| 151 | + |
| 152 | + /** |
| 153 | + * Conversational role of the generated message. |
| 154 | + * |
| 155 | + * This will always be `"assistant"`. |
| 156 | + */ |
| 157 | + role: 'assistant'; |
| 158 | + |
| 159 | + /** |
| 160 | + * Structured information about a refusal. |
| 161 | + */ |
| 162 | + stop_details: RefusalStopDetails | null; |
| 163 | + |
| 164 | + /** |
| 165 | + * The reason that we stopped. |
| 166 | + * |
| 167 | + * This may be one the following values: |
| 168 | + * |
| 169 | + * - `"end_turn"`: the model reached a natural stopping point |
| 170 | + * - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum |
| 171 | + * - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated |
| 172 | + * - `"tool_use"`: the model invoked one or more tools |
| 173 | + * - `"pause_turn"`: we paused a long-running turn. You may provide the response |
| 174 | + * back as-is in a subsequent request to let the model continue. |
| 175 | + * - `"refusal"`: when streaming classifiers intervene to handle potential policy |
| 176 | + * violations |
| 177 | + * |
| 178 | + * In non-streaming mode this value is always non-null. In streaming mode, it is |
| 179 | + * null in the `message_start` event and non-null otherwise. |
| 180 | + */ |
| 181 | + stop_reason: StopReason | null; |
| 182 | + |
| 183 | + /** |
| 184 | + * Which custom stop sequence was generated, if any. |
| 185 | + * |
| 186 | + * This value will be a non-null string if one of your custom stop sequences was |
| 187 | + * generated. |
| 188 | + */ |
| 189 | + stop_sequence: string | null; |
| 190 | + |
| 191 | + /** |
| 192 | + * Object type. |
| 193 | + * |
| 194 | + * For Messages, this is always `"message"`. |
| 195 | + */ |
| 196 | + type: 'message'; |
| 197 | + |
| 198 | + /** |
| 199 | + * Billing and rate-limit usage. |
| 200 | + * |
| 201 | + * Anthropic's API bills and rate-limits by token counts, as tokens represent the |
| 202 | + * underlying cost to our systems. |
| 203 | + * |
| 204 | + * Under the hood, the API transforms requests into a format suitable for the |
| 205 | + * model. The model's output then goes through a parsing stage before becoming an |
| 206 | + * API response. As a result, the token counts in `usage` will not match one-to-one |
| 207 | + * with the exact visible content of an API request or response. |
| 208 | + * |
| 209 | + * For example, `output_tokens` will be non-zero, even for an empty string response |
| 210 | + * from Claude. |
| 211 | + * |
| 212 | + * Total input tokens in a request is the summation of `input_tokens`, |
| 213 | + * `cache_creation_input_tokens`, and `cache_read_input_tokens`. |
| 214 | + */ |
| 215 | + usage: Usage; |
| 216 | +} |
| 217 | +``` |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | +## Interaction API |
0 commit comments