broken formatting (#8325)

This commit is contained in:
Daria Fokina 2024-09-04 18:05:56 +02:00 committed by GitHub
parent a34869da3f
commit a292f0a24e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 27 additions and 25 deletions

View File

@ -89,7 +89,7 @@ class ChatPromptBuilder:
print(res)
>> {'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',
'index': 0, 'finish_reason': 'stop', 'usage': {'prompt_tokens': 37, 'completion_tokens': 201,
'total_tokens': 238}})]}}

View File

@ -26,7 +26,7 @@ class HuggingFaceAPIDocumentEmbedder:
Embeds documents using 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)
- [Self-hosted Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference)

View File

@ -23,7 +23,7 @@ class HuggingFaceAPITextEmbedder:
Embeds strings using 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)
- [Self-hosted Text Embeddings Inference](https://github.com/huggingface/text-embeddings-inference)

View File

@ -20,16 +20,16 @@ class DocumentSplitter:
and prevents exceeding language model context limits.
The DocumentSplitter is compatible with the following DocumentStores:
- (Astra)[https://docs.haystack.deepset.ai/docs/astradocumentstore]
- (Chroma)[https://docs.haystack.deepset.ai/docs/chromadocumentstore] limited support, overlapping information is
- [Astra](https://docs.haystack.deepset.ai/docs/astradocumentstore)
- [Chroma](https://docs.haystack.deepset.ai/docs/chromadocumentstore) limited support, overlapping information is
not stored
- (Elasticsearch)[https://docs.haystack.deepset.ai/docs/elasticsearch-document-store]
- (OpenSearch)[https://docs.haystack.deepset.ai/docs/opensearch-document-store]
- (Pgvector)[https://docs.haystack.deepset.ai/docs/pgvectordocumentstore]
- (Pinecone)[https://docs.haystack.deepset.ai/docs/pinecone-document-store] limited support, overlapping
- [Elasticsearch](https://docs.haystack.deepset.ai/docs/elasticsearch-document-store)
- [OpenSearch](https://docs.haystack.deepset.ai/docs/opensearch-document-store)
- [Pgvector](https://docs.haystack.deepset.ai/docs/pgvectordocumentstore)
- [Pinecone](https://docs.haystack.deepset.ai/docs/pinecone-document-store) limited support, overlapping
information is not stored
- (Qdrant)[https://docs.haystack.deepset.ai/docs/qdrant-document-store]
- (Weaviate)[https://docs.haystack.deepset.ai/docs/weaviatedocumentstore]
- [Qdrant](https://docs.haystack.deepset.ai/docs/qdrant-document-store)
- [Weaviate](https://docs.haystack.deepset.ai/docs/weaviatedocumentstore)
### Usage example

View File

@ -20,7 +20,8 @@ class MetaFieldRanker:
The ranking can be performed in descending order or ascending order.
Usage example:
```
```python
from haystack import Document
from haystack.components.rankers import MetaFieldRanker
@ -34,6 +35,7 @@ class MetaFieldRanker:
output = ranker.run(documents=docs)
docs = output["documents"]
assert docs[0].content == "Barcelona"
```
"""
def __init__(
@ -69,11 +71,11 @@ class MetaFieldRanker:
:param missing_meta:
What to do with documents that are missing the sorting metadata field.
Possible values are:
- 'drop' will drop the documents entirely.
- 'top' will place the documents at the top of the metadata-sorted list
(regardless of 'ascending' or 'descending').
- 'bottom' will place the documents at the bottom of metadata-sorted list
(regardless of 'ascending' or 'descending').
- 'drop' will drop the documents entirely.
- 'top' will place the documents at the top of the metadata-sorted list
(regardless of 'ascending' or 'descending').
- 'bottom' will place the documents at the bottom of metadata-sorted list
(regardless of 'ascending' or 'descending').
:param meta_value_type:
Parse the meta value into the data type specified before sorting.
This will only work if all meta values stored under `meta_field` in the provided documents are strings.

View File

@ -25,12 +25,12 @@ class SentenceWindowRetriever:
SentenceWindowRetriever to get the surrounding documents for context.
The SentenceWindowRetriever is compatible with the following DocumentStores:
- (Astra)[https://docs.haystack.deepset.ai/docs/astradocumentstore]
- (Elasticsearch)[https://docs.haystack.deepset.ai/docs/elasticsearch-document-store]
- (OpenSearch)[https://docs.haystack.deepset.ai/docs/opensearch-document-store]
- (Pgvector)[https://docs.haystack.deepset.ai/docs/pgvectordocumentstore]
- (Pinecone)[https://docs.haystack.deepset.ai/docs/pinecone-document-store]
- (Qdrant)[https://docs.haystack.deepset.ai/docs/qdrant-document-store]
- [Astra](https://docs.haystack.deepset.ai/docs/astradocumentstore)
- [Elasticsearch](https://docs.haystack.deepset.ai/docs/elasticsearch-document-store)
- [OpenSearch](https://docs.haystack.deepset.ai/docs/opensearch-document-store)
- [Pgvector](https://docs.haystack.deepset.ai/docs/pgvectordocumentstore)
- [Pinecone](https://docs.haystack.deepset.ai/docs/pinecone-document-store)
- [Qdrant](https://docs.haystack.deepset.ai/docs/qdrant-document-store)
### Usage example

View File

@ -42,11 +42,11 @@ class TransformersTextRouter:
name="text_router"
)
p.add_component(
instance=PromptBuilder(template="Answer the question: {{query}}\nAnswer:"),
instance=PromptBuilder(template="Answer the question: {{query}}\\nAnswer:"),
name="english_prompt_builder"
)
p.add_component(
instance=PromptBuilder(template="Beantworte die Frage: {{query}}\nAntwort:"),
instance=PromptBuilder(template="Beantworte die Frage: {{query}}\\nAntwort:"),
name="german_prompt_builder"
)