Custom model docs

This commit is contained in:
Gui Vieira
2024-03-21 21:13:36 -03:00
parent 1c8d010601
commit 95fb44be88
15 changed files with 401 additions and 9 deletions

View File

@@ -27,3 +27,31 @@ tool = PDFSearchTool(pdf='path/to/your/document.pdf')
## Arguments
- `pdf`: **Optinal** The PDF path for the search. Can be provided at initialization or within the `run` method's arguments. If provided at initialization, the tool confines its search to the specified document.
## Custom model and embeddings
By default, the tool uses OpenAI for both embeddings and summarization. To customize the model, you can use a config dictionary as follows:
```python
tool = PDFSearchTool(
config=dict(
llm=dict(
provider="ollama", # or google, openai, anthropic, llama2, ...
config=dict(
model="llama2",
# temperature=0.5,
# top_p=1,
# stream=true,
),
),
embedder=dict(
provider="google",
config=dict(
model="models/embedding-001",
task_type="retrieval_document",
# title="Embeddings",
),
),
)
)
```