Skip to content

Commit 5024704

Browse files
committed
linting issues fixed for CI
1 parent 0a676af commit 5024704

4 files changed

Lines changed: 131 additions & 6 deletions

File tree

.github/workflows/olostep.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ jobs:
4444
steps:
4545
- id: set
4646
run: |
47-
echo 'os=${{ github.event_name == 'push' && '["ubuntu-latest"]' || env.TEST_MATRIX_OS }}' >> $GITHUB_OUTPUT
48-
echo 'python-version=${{ github.event_name == 'push' && '["3.10"]' || env.TEST_MATRIX_PYTHON }}' >> $GITHUB_OUTPUT
47+
if [ "${{ github.event_name }}" = "push" ]; then
48+
echo 'os=["ubuntu-latest"]' >> "$GITHUB_OUTPUT"
49+
echo 'python-version=["3.10"]' >> "$GITHUB_OUTPUT"
50+
else
51+
echo "os=${TEST_MATRIX_OS}" >> "$GITHUB_OUTPUT"
52+
echo "python-version=${TEST_MATRIX_PYTHON}" >> "$GITHUB_OUTPUT"
53+
fi
4954
5055
run:
5156
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}

integrations/olostep/olostep.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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.

integrations/olostep/pydoc/config_docusaurus.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
loaders:
22
- modules:
3-
- haystack_integrations.components.tools.olostep.tool
3+
- olostep_haystack.web_search
4+
- olostep_haystack.fetcher
45
search_path: [../src]
56
processors:
67
- type: filter

integrations/olostep/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ dependencies = [
6363
unit = 'pytest -m "not integration" {args:tests}'
6464
integration = 'pytest -m "integration" {args:tests}'
6565
all = 'pytest {args:tests}'
66-
unit-cov-retry = 'pytest --cov=haystack_integrations --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}'
67-
integration-cov-append-retry = 'pytest --cov=haystack_integrations --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}'
66+
unit-cov-retry = 'pytest --cov=olostep_haystack --reruns 3 --reruns-delay 30 -x -m "not integration" {args:tests}'
67+
integration-cov-append-retry = 'pytest --cov=olostep_haystack --cov-append --reruns 3 --reruns-delay 30 -x -m "integration" {args:tests}'
6868
types = "mypy -p olostep_haystack {args}"
6969

7070
[tool.mypy]
@@ -145,7 +145,7 @@ ban-relative-imports = "parents"
145145
"tests/**/*" = ["PLR2004", "S101", "TID252", "D", "ANN"]
146146

147147
[tool.coverage.run]
148-
source = ["haystack_integrations"]
148+
source = ["olostep_haystack"]
149149
branch = true
150150
parallel = false
151151
relative_files = true

0 commit comments

Comments
 (0)