mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-29 16:36:34 +00:00
broken formatting (#8325)
This commit is contained in:
parent
a34869da3f
commit
a292f0a24e
@ -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}})]}}
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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"
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user