You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integrations/anthropic.md
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,8 @@ Before using, make sure to set the `ANTHROPIC_API_KEY` environment variable.
57
57
Below is an example RAG Pipeline where we answer a predefined question using the contents from the below mentioned URL pointing to Anthropic prompt engineering guide. We fetch the contents of the URL and generate an answer with the `AnthropicChatGenerator`.
58
58
59
59
```python
60
+
# To run this example, you will need to set a `ANTHROPIC_API_KEY` environment variable.
61
+
60
62
from haystack import Pipeline
61
63
from haystack.components.builders import ChatPromptBuilder
62
64
from haystack.components.converters import HTMLToDocument
@@ -69,18 +71,23 @@ from haystack_integrations.components.generators.anthropic import AnthropicChatG
69
71
70
72
messages = [
71
73
ChatMessage.from_system("You are a prompt expert who answers questions based on the given documents."),
72
-
ChatMessage.from_user("Here are the documents: {{documents}}\\n Answer: {{query}}"),
0 commit comments