Assistant
. Эта мощная техника позволяет вам направлять действия Claude, пропускать преамбулы, обеспечивать определенные форматы, такие как JSON или XML, и даже помогать Claude поддерживать согласованность персонажа в сценариях ролевой игры.
В некоторых случаях, когда Claude не работает должным образом, несколько предзаполненных предложений могут значительно улучшить производительность Claude. Небольшое предзаполнение имеет большое значение!
Assistant
(ответ Claude будет продолжаться с того места, где заканчивается сообщение Assistant
):
"As an AI assistant, I "
(с пробелом в конце) приведет к ошибке.{
заставляет Claude пропустить преамбулу и напрямую выводить объект JSON. Это чище, лаконичнее и проще для программ для анализа без дополнительной обработки.Пример: Извлечение структурированных данных без предзаполнения
Роль | Содержание |
---|---|
User | Extract the name, size, price, and color from this product description as a JSON object: <description> The SmartHome Mini is a compact smart home assistant available in black or white for only $49.99. At just 5 inches wide, it lets you control lights, thermostats, and other connected devices via voice or app—no matter where you place it in your home. This affordable little hub brings convenient hands-free control to your smart devices. </description> |
Assistant | Here’s the extracted information in JSON format: ```json { “name”: “SmartHome Mini”, “size”: “5 inches wide”, “price”: “$49.99”, “colors”: [“black”, “white”] } ``` I’ve extracted the following details from the product description: - Name: SmartHome Mini - Size: 5 inches wide - Price: $49.99 - Colors: Available in black and white The JSON object provides a structured format that’s easy for programs to parse and use. Let me know if you need any modifications or have any other questions! |
Пример: Извлечение структурированных данных с предзаполнением
Роль | Содержание |
---|---|
User | Extract the name, size, price, and color from this product description as a JSON object: <description> The SmartHome Mini is a compact smart home assistant available in black or white for only $49.99. At just 5 inches wide, it lets you control lights, thermostats, and other connected devices via voice or app—no matter where you place it in your home. This affordable little hub brings convenient hands-free control to your smart devices. </description> |
Assistant (предзаполнение) | { |
Assistant (ответ Claude) | “name”: “SmartHome Mini”, “size”: “5 inches wide”, “price”: “$49.99”, “colors”: [ “black”, “white” ] } |
[ИМЯ_РОЛИ]
в квадратных скобках может напомнить Claude оставаться в образе, даже для более длительных и сложных разговоров. Это особенно эффективно в сочетании с ролевыми подсказками в параметре system
.Пример: Поддержание характера без ролевых подсказок
Роль | Содержание |
---|---|
User (50 ходов в разговоре с Claude в роли “Шерлока Холмса”) | What do you deduce about the owner of this shoe? <image>muddy_shoe.jpg</image> |
Assistant | As an AI assistant, I would be happy to analyze the image of a muddy shoe as if you had provided it. Here’s my deduction… |
Пример: Поддержание характера с ролевыми подсказками
Роль | Содержание |
---|---|
User (50 ходов в разговоре с Claude в роли “Шерлока Холмса”) | What do you deduce about the owner of this shoe? <image>muddy_shoe.jpg</image> |
Assistant (предзаполнение) | [Sherlock Holmes] |
Assistant (ответ Claude) | Ah, what have we here? A most curious specimen, Watson! Let us examine this shoe with a discerning eye. The mud, you see, is not your common London clay, but rather the distinctive reddish hue of the iron-rich soil found only in the environs of Hampstead Heath. And yet, the wear on the sole suggests a gait more suited to the cobblestones of Whitechapel than the gentle slopes of the Heath. Now, observe the laces! They are tied with a particular knot favored by those in the medical profession—doubtless a habit acquired during years of tying surgical gowns. But the scuff marks on the toe box tell a different tale: they are consistent with the kicking motion one might employ in the martial arts, specifically Baritsu. We may conclude, then, that our absent shoe owner is a doctor, possibly a surgeon, who resides in Whitechapel but frequents Hampstead Heath—perhaps for a secret Baritsu practice, away from prying eyes. A most intriguing case, Watson! We must make haste; the game is afoot! |