|
| 1 | +--- |
| 2 | +title: "Olostep" |
| 3 | +id: integrations-olostep |
| 4 | +description: "Olostep integration for Haystack" |
| 5 | +slug: "/integrations-olostep" |
| 6 | +--- |
| 7 | + |
| 8 | + |
| 9 | +## olostep_haystack.fetcher |
| 10 | + |
| 11 | +### OlostepFetcherError |
| 12 | + |
| 13 | +Bases: <code>Exception</code> |
| 14 | + |
| 15 | +Raised when Olostep fetching fails. |
| 16 | + |
| 17 | +### OlostepFetcher |
| 18 | + |
| 19 | +Fetch and convert web pages to Markdown using Olostep's scrape API. |
| 20 | + |
| 21 | +Uses SyncOlostepClient (the current Olostep Python SDK). |
| 22 | +Do NOT use the legacy Olostep class with client.scrapes.create(). |
| 23 | + |
| 24 | +Usage: |
| 25 | +from olostep_haystack import OlostepFetcher |
| 26 | +fetcher = OlostepFetcher(api_key=Secret.from_env_var("OLOSTEP_API_KEY")) |
| 27 | +result = fetcher.run(urls=["https://example.com"]) |
| 28 | +\# result["documents"] -> List[Document] |
| 29 | + |
| 30 | +#### run |
| 31 | + |
| 32 | +```python |
| 33 | +run(urls: list[str]) -> dict[str, Any] |
| 34 | +``` |
| 35 | + |
| 36 | +Fetch one or more URLs and return their content as Documents. |
| 37 | + |
| 38 | +**Parameters:** |
| 39 | + |
| 40 | +- **urls** (<code>list\[str\]</code>) – list of URLs to scrape |
| 41 | + |
| 42 | +**Returns:** |
| 43 | + |
| 44 | +- <code>dict\[str, Any\]</code> – dict with 'documents' (List[Document]) |
| 45 | + |
| 46 | +**Raises:** |
| 47 | + |
| 48 | +- <code>OlostepFetcherError</code> – on API failure |
| 49 | + |
| 50 | +#### to_dict |
| 51 | + |
| 52 | +```python |
| 53 | +to_dict() -> dict[str, Any] |
| 54 | +``` |
| 55 | + |
| 56 | +Serialize the component to a dictionary. |
| 57 | + |
| 58 | +#### from_dict |
| 59 | + |
| 60 | +```python |
| 61 | +from_dict(data: dict[str, Any]) -> OlostepFetcher |
| 62 | +``` |
| 63 | + |
| 64 | +Deserialize a component from a dictionary. |
| 65 | + |
| 66 | +## olostep_haystack.web_search |
| 67 | + |
| 68 | +### OlostepSearchError |
| 69 | + |
| 70 | +Bases: <code>Exception</code> |
| 71 | + |
| 72 | +Raised when Olostep search fails. |
| 73 | + |
| 74 | +### OlostepWebSearch |
| 75 | + |
| 76 | +Search the web using Olostep's /searches endpoint. |
| 77 | + |
| 78 | +Usage: |
| 79 | +from olostep_haystack import OlostepWebSearch |
| 80 | +search = OlostepWebSearch(api_key=Secret.from_env_var("OLOSTEP_API_KEY")) |
| 81 | +result = search.run(query="what is haystack?") |
| 82 | +\# result["documents"] -> List[Document] |
| 83 | +\# result["links"] -> List[str] |
| 84 | + |
| 85 | +#### run |
| 86 | + |
| 87 | +```python |
| 88 | +run(query: str) -> dict[str, Any] |
| 89 | +``` |
| 90 | + |
| 91 | +Search the web using Olostep. |
| 92 | + |
| 93 | +**Parameters:** |
| 94 | + |
| 95 | +- **query** (<code>str</code>) – the search query string |
| 96 | + |
| 97 | +**Returns:** |
| 98 | + |
| 99 | +- <code>dict\[str, Any\]</code> – dict with 'documents' (List[Document]) and 'links' (List[str]) |
| 100 | + |
| 101 | +**Raises:** |
| 102 | + |
| 103 | +- <code>OlostepSearchError</code> – on API failure |
| 104 | + |
| 105 | +#### to_dict |
| 106 | + |
| 107 | +```python |
| 108 | +to_dict() -> dict[str, Any] |
| 109 | +``` |
| 110 | + |
| 111 | +Serialize the component to a dictionary. |
| 112 | + |
| 113 | +#### from_dict |
| 114 | + |
| 115 | +```python |
| 116 | +from_dict(data: dict[str, Any]) -> OlostepWebSearch |
| 117 | +``` |
| 118 | + |
| 119 | +Deserialize a component from a dictionary. |
0 commit comments