mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-03 18:36:04 +00:00
broken formatting (#8325)
This commit is contained in:
parent
a34869da3f
commit
a292f0a24e
@ -89,7 +89,7 @@ class ChatPromptBuilder:
|
|||||||
|
|
||||||
print(res)
|
print(res)
|
||||||
>> {'llm': {'replies': [ChatMessage(content="Here is the weather forecast for Berlin in the next 5
|
>> {'llm': {'replies': [ChatMessage(content="Here is the weather forecast for Berlin in the next 5
|
||||||
days:\n\nDay 1: Mostly cloudy with a high of 22°C (72°F) and...so it's always a good idea to check for updates
|
days:\\n\\nDay 1: Mostly cloudy with a high of 22°C (72°F) and...so it's always a good idea to check for updates
|
||||||
closer to your visit.", role=<ChatRole.ASSISTANT: 'assistant'>, name=None, meta={'model': 'gpt-3.5-turbo-0613',
|
closer to your visit.", role=<ChatRole.ASSISTANT: 'assistant'>, name=None, meta={'model': 'gpt-3.5-turbo-0613',
|
||||||
'index': 0, 'finish_reason': 'stop', 'usage': {'prompt_tokens': 37, 'completion_tokens': 201,
|
'index': 0, 'finish_reason': 'stop', 'usage': {'prompt_tokens': 37, 'completion_tokens': 201,
|
||||||
'total_tokens': 238}})]}}
|
'total_tokens': 238}})]}}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class HuggingFaceAPIDocumentEmbedder:
|
|||||||
Embeds documents using Hugging Face APIs.
|
Embeds documents using Hugging Face APIs.
|
||||||
|
|
||||||
Use it with the following Hugging Face APIs:
|
Use it with the following Hugging Face APIs:
|
||||||
- [Free Serverless Inference API]((https://huggingface.co/inference-api)
|
- [Free Serverless Inference API](https://huggingface.co/inference-api)
|
||||||
- [Paid Inference Endpoints](https://huggingface.co/inference-endpoints)
|
- [Paid Inference Endpoints](https://huggingface.co/inference-endpoints)
|
||||||
- [Self-hosted Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference)
|
- [Self-hosted Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference)
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class HuggingFaceAPITextEmbedder:
|
|||||||
Embeds strings using Hugging Face APIs.
|
Embeds strings using Hugging Face APIs.
|
||||||
|
|
||||||
Use it with the following Hugging Face APIs:
|
Use it with the following Hugging Face APIs:
|
||||||
- [Free Serverless Inference API]((https://huggingface.co/inference-api)
|
- [Free Serverless Inference API](https://huggingface.co/inference-api)
|
||||||
- [Paid Inference Endpoints](https://huggingface.co/inference-endpoints)
|
- [Paid Inference Endpoints](https://huggingface.co/inference-endpoints)
|
||||||
- [Self-hosted Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference)
|
- [Self-hosted Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference)
|
||||||
|
|
||||||
|
|||||||
@ -20,16 +20,16 @@ class DocumentSplitter:
|
|||||||
and prevents exceeding language model context limits.
|
and prevents exceeding language model context limits.
|
||||||
|
|
||||||
The DocumentSplitter is compatible with the following DocumentStores:
|
The DocumentSplitter is compatible with the following DocumentStores:
|
||||||
- (Astra)[https://docs.haystack.deepset.ai/docs/astradocumentstore]
|
- [Astra](https://docs.haystack.deepset.ai/docs/astradocumentstore)
|
||||||
- (Chroma)[https://docs.haystack.deepset.ai/docs/chromadocumentstore] limited support, overlapping information is
|
- [Chroma](https://docs.haystack.deepset.ai/docs/chromadocumentstore) limited support, overlapping information is
|
||||||
not stored
|
not stored
|
||||||
- (Elasticsearch)[https://docs.haystack.deepset.ai/docs/elasticsearch-document-store]
|
- [Elasticsearch](https://docs.haystack.deepset.ai/docs/elasticsearch-document-store)
|
||||||
- (OpenSearch)[https://docs.haystack.deepset.ai/docs/opensearch-document-store]
|
- [OpenSearch](https://docs.haystack.deepset.ai/docs/opensearch-document-store)
|
||||||
- (Pgvector)[https://docs.haystack.deepset.ai/docs/pgvectordocumentstore]
|
- [Pgvector](https://docs.haystack.deepset.ai/docs/pgvectordocumentstore)
|
||||||
- (Pinecone)[https://docs.haystack.deepset.ai/docs/pinecone-document-store] limited support, overlapping
|
- [Pinecone](https://docs.haystack.deepset.ai/docs/pinecone-document-store) limited support, overlapping
|
||||||
information is not stored
|
information is not stored
|
||||||
- (Qdrant)[https://docs.haystack.deepset.ai/docs/qdrant-document-store]
|
- [Qdrant](https://docs.haystack.deepset.ai/docs/qdrant-document-store)
|
||||||
- (Weaviate)[https://docs.haystack.deepset.ai/docs/weaviatedocumentstore]
|
- [Weaviate](https://docs.haystack.deepset.ai/docs/weaviatedocumentstore)
|
||||||
|
|
||||||
### Usage example
|
### Usage example
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,8 @@ class MetaFieldRanker:
|
|||||||
The ranking can be performed in descending order or ascending order.
|
The ranking can be performed in descending order or ascending order.
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
```
|
|
||||||
|
```python
|
||||||
from haystack import Document
|
from haystack import Document
|
||||||
from haystack.components.rankers import MetaFieldRanker
|
from haystack.components.rankers import MetaFieldRanker
|
||||||
|
|
||||||
@ -34,6 +35,7 @@ class MetaFieldRanker:
|
|||||||
output = ranker.run(documents=docs)
|
output = ranker.run(documents=docs)
|
||||||
docs = output["documents"]
|
docs = output["documents"]
|
||||||
assert docs[0].content == "Barcelona"
|
assert docs[0].content == "Barcelona"
|
||||||
|
```
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
|||||||
@ -25,12 +25,12 @@ class SentenceWindowRetriever:
|
|||||||
SentenceWindowRetriever to get the surrounding documents for context.
|
SentenceWindowRetriever to get the surrounding documents for context.
|
||||||
|
|
||||||
The SentenceWindowRetriever is compatible with the following DocumentStores:
|
The SentenceWindowRetriever is compatible with the following DocumentStores:
|
||||||
- (Astra)[https://docs.haystack.deepset.ai/docs/astradocumentstore]
|
- [Astra](https://docs.haystack.deepset.ai/docs/astradocumentstore)
|
||||||
- (Elasticsearch)[https://docs.haystack.deepset.ai/docs/elasticsearch-document-store]
|
- [Elasticsearch](https://docs.haystack.deepset.ai/docs/elasticsearch-document-store)
|
||||||
- (OpenSearch)[https://docs.haystack.deepset.ai/docs/opensearch-document-store]
|
- [OpenSearch](https://docs.haystack.deepset.ai/docs/opensearch-document-store)
|
||||||
- (Pgvector)[https://docs.haystack.deepset.ai/docs/pgvectordocumentstore]
|
- [Pgvector](https://docs.haystack.deepset.ai/docs/pgvectordocumentstore)
|
||||||
- (Pinecone)[https://docs.haystack.deepset.ai/docs/pinecone-document-store]
|
- [Pinecone](https://docs.haystack.deepset.ai/docs/pinecone-document-store)
|
||||||
- (Qdrant)[https://docs.haystack.deepset.ai/docs/qdrant-document-store]
|
- [Qdrant](https://docs.haystack.deepset.ai/docs/qdrant-document-store)
|
||||||
|
|
||||||
### Usage example
|
### Usage example
|
||||||
|
|
||||||
|
|||||||
@ -42,11 +42,11 @@ class TransformersTextRouter:
|
|||||||
name="text_router"
|
name="text_router"
|
||||||
)
|
)
|
||||||
p.add_component(
|
p.add_component(
|
||||||
instance=PromptBuilder(template="Answer the question: {{query}}\nAnswer:"),
|
instance=PromptBuilder(template="Answer the question: {{query}}\\nAnswer:"),
|
||||||
name="english_prompt_builder"
|
name="english_prompt_builder"
|
||||||
)
|
)
|
||||||
p.add_component(
|
p.add_component(
|
||||||
instance=PromptBuilder(template="Beantworte die Frage: {{query}}\nAntwort:"),
|
instance=PromptBuilder(template="Beantworte die Frage: {{query}}\\nAntwort:"),
|
||||||
name="german_prompt_builder"
|
name="german_prompt_builder"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user