Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ result = pipe.run(
)
print(result)

# {'llm': {'replies': ['The most famous landmark in Berlin is the **Brandenburg Gate**. It is considered the symbol of the city and represents reunification.'], 'meta': [{'model': 'gpt-4o-mini-2024-07-18', 'index': 0, 'finish_reason': 'stop', 'usage': {'completion_tokens': 27, 'prompt_tokens': 4479, 'total_tokens': 4506, 'completion_tokens_details': CompletionTokensDetails(accepted_prediction_tokens=0, audio_tokens=0, reasoning_tokens=0, rejected_prediction_tokens=0), 'prompt_tokens_details': PromptTokensDetails(audio_tokens=0, cached_tokens=0)}}]}}
# {'llm': {'replies': [ChatMessage(_role=<ChatRole.ASSISTANT: 'assistant'>, _content=[TextContent(text='The most famous landmark in Berlin is the **Brandenburg Gate**. It is considered the symbol of the city and represents reunification.')], _name=None, _meta={'model': 'gpt-4o-mini-2024-07-18', 'index': 0, 'finish_reason': 'stop', 'usage': {'completion_tokens': 27, 'prompt_tokens': 4479, 'total_tokens': 4506}})]}}
```

The same component in search mode could also be used in an indexing pipeline.
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,12 @@ You can stream output as it’s generated. Pass a callback to `streaming_callbac
```python
from haystack.components.generators.utils import print_streaming_chunk

# Configure any `Generator` or `ChatGenerator` with a streaming callback
component = SomeGeneratorOrChatGenerator(streaming_callback=print_streaming_chunk)
# Configure any `ChatGenerator` with a streaming callback
component = SomeChatGenerator(streaming_callback=print_streaming_chunk)

# If this is a `ChatGenerator`, pass a list of messages:
# Pass a list of messages:
# from haystack.dataclasses import ChatMessage
# component.run([ChatMessage.from_user("Your question here")])

# If this is a (non-chat) `Generator`, pass a prompt:
# component.run({"prompt": "Your prompt here"})
```

:::info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,12 @@ You can stream output as it's generated. Pass a callback to `streaming_callback`
```python
from haystack.components.generators.utils import print_streaming_chunk

# Configure any `Generator` or `ChatGenerator` with a streaming callback
component = SomeGeneratorOrChatGenerator(streaming_callback=print_streaming_chunk)
# Configure any `ChatGenerator` with a streaming callback
component = SomeChatGenerator(streaming_callback=print_streaming_chunk)

# If this is a `ChatGenerator`, pass a list of messages:
# Pass a list of messages:
# from haystack.dataclasses import ChatMessage
# component.run([ChatMessage.from_user("Your question here")])

# If this is a (non-chat) `Generator`, pass a prompt:
# component.run({"prompt": "Your prompt here"})
```

:::info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ You can stream output as it’s generated. Pass a callback to `streaming_callbac
from haystack.components.generators.chat.openai import OpenAIChatGenerator
from haystack.components.generators.utils import print_streaming_chunk

# Configure any `Generator` or `ChatGenerator` with a streaming callback
# Configure any `ChatGenerator` with a streaming callback
component = OpenAIChatGenerator(streaming_callback=print_streaming_chunk)

# pass a list of messages or a single string to `run()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,12 @@ You can stream output as it's generated. Pass a callback to `streaming_callback`
```python
from haystack.components.generators.utils import print_streaming_chunk

# Configure any `Generator` or `ChatGenerator` with a streaming callback
component = SomeGeneratorOrChatGenerator(streaming_callback=print_streaming_chunk)
# Configure any `ChatGenerator` with a streaming callback
component = SomeChatGenerator(streaming_callback=print_streaming_chunk)

# If this is a `ChatGenerator`, pass a list of messages:
# Pass a list of messages:
# from haystack.dataclasses import ChatMessage
# component.run([ChatMessage.from_user("Your question here")])

# If this is a (non-chat) `Generator`, pass a prompt:
# component.run({"prompt": "Your prompt here"})
```

:::info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A Hybrid Retriever uses both traditional keyword-based search (BM25) and embeddi

| | |
| --- | --- |
| **Most common position in a pipeline** | 1. After a TextEmbedder and before a PromptBuilder in a RAG pipeline 2. The last component in a hybrid search pipeline 3. After a TextEmbedder and before an ExtractiveReader in an extractive QA pipeline |
| **Most common position in a pipeline** | 1. After a TextEmbedder and before a PromptBuilder in a RAG pipeline 2. The last component in a hybrid search pipeline 3. After a TextEmbedder and before a TransformersExtractiveReader in an extractive QA pipeline |
| **Mandatory init variables** | `document_store`: An instance of [`ElasticsearchDocumentStore`](../../document-stores/elasticsearch-document-store.mdx) <br /> <br />`embedder`: Any [Embedder](../embedders.mdx) implementing the `TextEmbedder` protocol |
| **Mandatory run variables** | `query`: A query string |
| **Output variables** | `documents`: A list of documents matching the query |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: "GitHubFileEditorTool"
id: githubfileeditortool
slug: "/githubfileeditortool"
description: "A Tool that allows Agents and ToolInvokers to edit files in GitHub repositories."
description: "A Tool that allows Agents to edit files in GitHub repositories."
---

# GitHubFileEditorTool

A Tool that allows Agents and ToolInvokers to edit files in GitHub repositories.
A Tool that allows Agents to edit files in GitHub repositories.

<div className="key-value-table">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: "GitHubIssueCommenterTool"
id: githubissuecommentertool
slug: "/githubissuecommentertool"
description: "A Tool that allows Agents and ToolInvokers to post comments to GitHub issues."
description: "A Tool that allows Agents to post comments to GitHub issues."
---

# GitHubIssueCommenterTool

A Tool that allows Agents and ToolInvokers to post comments to GitHub issues.
A Tool that allows Agents to post comments to GitHub issues.

<div className="key-value-table">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: "GitHubIssueViewerTool"
id: githubissueviewertool
slug: "/githubissueviewertool"
description: "A Tool that allows Agents and ToolInvokers to fetch and parse GitHub issues into documents."
description: "A Tool that allows Agents to fetch and parse GitHub issues into documents."
---

# GitHubIssueViewerTool

A Tool that allows Agents and ToolInvokers to fetch and parse GitHub issues into documents.
A Tool that allows Agents to fetch and parse GitHub issues into documents.

<div className="key-value-table">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: "GitHubPRCreatorTool"
id: githubprcreatortool
slug: "/githubprcreatortool"
description: "A Tool that allows Agents and ToolInvokers to create pull requests from a fork back to the original repository."
description: "A Tool that allows Agents to create pull requests from a fork back to the original repository."
---

# GitHubPRCreatorTool

A Tool that allows Agents and ToolInvokers to create pull requests from a fork back to the original repository.
A Tool that allows Agents to create pull requests from a fork back to the original repository.

<div className="key-value-table">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: "GitHubRepoViewerTool"
id: githubrepoviewertool
slug: "/githubrepoviewertool"
description: "A Tool that allows Agents and ToolInvokers to navigate and fetch content from GitHub repositories."
description: "A Tool that allows Agents to navigate and fetch content from GitHub repositories."
---

# GitHubRepoViewerTool

A Tool that allows Agents and ToolInvokers to navigate and fetch content from GitHub repositories.
A Tool that allows Agents to navigate and fetch content from GitHub repositories.

<div className="key-value-table">

Expand Down