Skip to content

Commit b372597

Browse files
committed
update naming
1 parent 45525a3 commit b372597

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/websearch.py renamed to examples/web-search-crawl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ def format_tool_results(results: Union[WebSearchResponse, WebCrawlResponse]):
4949

5050

5151
client = Client(headers={'Authorization': (os.getenv('OLLAMA_API_KEY'))})
52-
available_tools = {'websearch': client.websearch, 'webcrawl': client.webcrawl}
52+
available_tools = {'web_search': client.web_search, 'web_crawl': client.web_crawl}
5353

5454
query = "ollama's new engine"
5555
print('Query: ', query)
5656

5757
messages = [{'role': 'user', 'content': query}]
5858
while True:
59-
response = client.chat(model='qwen3', messages=messages, tools=[client.websearch, client.webcrawl], think=True)
59+
response = client.chat(model='qwen3', messages=messages, tools=[client.web_search, client.web_crawl], think=True)
6060
if response.message.thinking:
6161
print('Thinking: ')
6262
print(response.message.thinking + '\n\n')

ollama/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@
5555
copy = _client.copy
5656
show = _client.show
5757
ps = _client.ps
58-
websearch = _client.websearch
59-
webcrawl = _client.webcrawl
58+
websearch = _client.web_search
59+
webcrawl = _client.web_crawl

ollama/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def ps(self) -> ProcessResponse:
628628
'/api/ps',
629629
)
630630

631-
def websearch(self, queries: Sequence[str], max_results: int = 3) -> WebSearchResponse:
631+
def web_search(self, queries: Sequence[str], max_results: int = 3) -> WebSearchResponse:
632632
"""
633633
Performs a web search
634634
@@ -649,7 +649,7 @@ def websearch(self, queries: Sequence[str], max_results: int = 3) -> WebSearchRe
649649
).model_dump(exclude_none=True),
650650
)
651651

652-
def webcrawl(self, urls: Sequence[str]) -> WebCrawlResponse:
652+
def web_crawl(self, urls: Sequence[str]) -> WebCrawlResponse:
653653
"""
654654
Gets the content of web pages for the provided URLs.
655655

0 commit comments

Comments
 (0)