You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e99b704
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -287,6 +287,18 @@ If you run into any issues, consult the logs or reach out on the repository's [I
287
287
288
288
> The current application version is stored in the repository-root `VERSION` file and loaded by the runtime from there. Update `VERSION` once for a release instead of duplicating the current version in source files.
289
289
290
+
- v0.8.10 - Preserve formatting in replies with web citations
291
+
- Render the formatted reply before adding source links, so bold and italics display correctly after web tool calls.
292
+
- Split long cited replies with balanced HTML tags, keeping code literal and citation links intact.
293
+
294
+
- v0.8.9 - Fetch DuckDuckGo and webpages directly with Lynx
295
+
- DuckDuckGo uses `lynx -dump` to fetch the results page. Its dump joins OpenAI and enabled Perplexity results in the combined search response.
296
+
- The separate `get_website_dump` tool also fetches URLs directly with Lynx. Timeouts cancel and reap the Lynx process.
297
+
298
+
- v0.8.8 - Restore Lynx browsing after web search
299
+
- The primary model can call `get_website_dump` after receiving combined search results and use the retrieved page content in its final answer.
300
+
- Follow-up web calls preserve local context and distinct clickable citations. `[WebSearch] MaxWebToolCalls` defaults to four calls per reply.
301
+
290
302
- v0.8.7 - Combined web search and news retrieval fallback
291
303
- Each web search sends the tool query to all enabled providers under one timeout and returns their findings and citations in one tool result. DuckDuckGo and OpenAI are enabled by default.
292
304
- Elasticsearch news actions retain their existing tokens. Failed or stale RSS feeds can use publisher-scoped web search and the corresponding section page. See [web search settings](docs/WEB_SEARCH.md).
Copy file name to clipboardExpand all lines: docs/WEB_SEARCH.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Web search and news retrieval
2
2
3
-
The primary Chat Completions model can call `search_web({"query": "..."})`. The Python handler selects providers from `config/config.ini`. Each receives the query supplied in that call. The handler returns provider-labelled evidence in one tool result. Only the primary model receives the chat history when writing the Telegram reply. OpenAI's hosted search uses the existing project key and a separate request to `POST /v1/responses`. Each invocation requests one hosted web search.
3
+
The primary Chat Completions model can call `search_web({"query": "..."})`. The Python handler selects providers from `config/config.ini`. Each receives the query supplied in that call. The handler returns provider-labelled evidence in one tool result. The primary model can then call `get_website_dump` to read selected URLs through Lynx before answering. Each webpage result is returned in its own tool message alongside the existing local context and search evidence. Only the primary model receives the chat history when writing the Telegram reply. OpenAI's hosted search uses the existing project key and a separate request to `POST /v1/responses`. Each invocation requests one hosted web search.
4
4
5
5
## Install the ZIP update on Linux
6
6
@@ -25,6 +25,7 @@ UseOpenAIWebSearch = True
25
25
OpenAIModel = gpt-6-luna
26
26
FallbackToOpenAI = True
27
27
TimeoutSeconds = 30
28
+
MaxWebToolCalls = 4
28
29
NewsMaxAgeDays = 7
29
30
30
31
[DuckDuckGo]
@@ -34,7 +35,7 @@ Enabled = True
34
35
Enabled = True
35
36
```
36
37
37
-
Perplexity also needs the existing `PERPLEXITY_API_KEY` environment variable. DuckDuckGo uses the existing Lynx installation. Every model-requested web search starts all enabled providers concurrently and gives the primary model their results together, with provider labels and source links. DuckDuckGo and initial OpenAI web search default to enabled. Perplexity retains its existing enabled setting. Earlier `DefaultProvider` entries are ignored. Only the standalone diagnostic command can select an individual provider.
38
+
Perplexity also needs the existing `PERPLEXITY_API_KEY` environment variable. DuckDuckGo runs `lynx -dump -width=200` against the search URL directly. The separate `get_website_dump` tool uses the same direct Lynx fetch. Every model-requested web search starts all enabled providers concurrently and gives the primary model their results together, with provider labels and source links. DuckDuckGo and initial OpenAI web search default to enabled. Perplexity retains its existing enabled setting. Earlier `DefaultProvider` entries are ignored. Only the standalone diagnostic command can select an individual provider.
38
39
39
40
| UseOpenAIWebSearch | FallbackToOpenAI | OpenAI hosted search behavior with the master switch enabled |
40
41
| --- | --- | --- |
@@ -45,8 +46,16 @@ Perplexity also needs the existing `PERPLEXITY_API_KEY` environment variable. Du
45
46
46
47
`OpenAIEnabled = False` disables hosted OpenAI search on every path. The primary Chat Completions model continues answering as usual. To change a setting, edit the existing `[WebSearch]` section and restart the bot.
47
48
49
+
`MaxWebToolCalls` counts the initial search or page call and any follow-up web tool calls made by the primary model, up to four by default. Each search still combines all enabled providers under one shared deadline. The model can read several pages and keeps the source URLs from earlier results. Failed page reads return an explicit failure to the model so it can use the remaining evidence. Direct Lynx browsing uses `get_website_dump` independently of the optional `[DuckDuckGo] EnableAgenticBrowsing` setting.
50
+
48
51
A multi-search starts the selected providers concurrently. One wall-clock deadline covers HTTP requests, retries and DuckDuckGo's optional browsing step. At the deadline the handler cancels unfinished local tasks and returns completed results. A failed lookup can use OpenAI at most once. A blocked website dump respects the existing domain restriction policy.
49
52
53
+
## Telegram reply formatting
54
+
55
+
Replies following web tool calls use the normal Markdown-to-HTML conversion before citation links are added. The model is instructed to use Telegram HTML and retain citation markers such as `[D1]`, `[O11]` and `[W2]`. Bold, italics and code are rendered by the bot even when the model uses Markdown. Citation replacement operates on text outside code and existing links. Long replies close and reopen formatting tags at message boundaries; source URLs and HTML entities are not cut in half. Source titles are escaped as text if the reply omits citation markers.
56
+
57
+
Version 0.8.10 fixes a branch that discarded the converted reply whenever web sources were present, leaving Markdown emphasis visible while citation links worked. This is a rendering correction; provider selection, direct Lynx fetching, tool availability and search deadlines retain their v0.8.9 behavior.
58
+
50
59
## Elasticsearch news actions
51
60
52
61
All 85 publisher/category action names continue to match existing Elasticsearch entries. A trigger first tries its configured RSS endpoint. A missing feed, HTTP error, unexpected content type, empty feed, or absence of recent usable articles immediately starts a publisher-scoped search when `FallbackToOpenAI` and `OpenAIEnabled` are enabled. OpenAI runs alongside enabled DuckDuckGo and Perplexity providers. Results are filtered to the specified publisher and dates. The search is limited to the publisher's domains and requests the trigger's particular section, language or region. It requires dated article citations. If that search is disabled, unavailable or yields no usable items, the action tries the corresponding publisher section page. If all routes fail, the primary model receives an explicit retrieval failure.
@@ -83,4 +92,4 @@ With three configured, reachable providers, the combined check prints three labe
83
92
84
93
The OpenAI API contract and supported models are documented in the [web search guide](https://developers.openai.com/api/docs/guides/tools-web-search), [Responses reference](https://developers.openai.com/api/reference/resources/responses/methods/create) and [GPT-6 Luna model page](https://developers.openai.com/api/docs/models/gpt-6-luna).
85
94
86
-
In this workspace the DuckDuckGo HTML endpoint served a challenge page. The adapter reports that as a failed search, even if the challenge contains feedback or navigation links. Publisher retrieval was tested live. OpenAI and Perplexity responses were tested with fixtures and HTTP mocks. No provider credentials or Telegram token were included in the snapshot.
95
+
The earlier HTTPX-based DuckDuckGo fetch served challenge pages. The deployment-host test supplied for v0.8.9 returned search results with direct Lynx. The adapter rejects dumps containing no external result links. Regression tests use a representative Lynx dump and mocked subprocess and provider responses. Publisher retrieval was tested live. OpenAI and Perplexity responses were tested with fixtures and HTTP mocks. No provider credentials or Telegram token were included in the snapshot.
Copy file name to clipboardExpand all lines: src/custom_functions.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ async def observe_chat():
68
68
69
69
custom_functions.append({
70
70
"name": "search_web",
71
-
"description": "Search the web when current information or external verification is needed.",
71
+
"description": "Find sources using all enabled search providers. Use get_website_dump to read a result page when its contents are needed.",
72
72
"parameters": {
73
73
"type": "object",
74
74
"properties": {"query": {"type": "string", "description": "The search query only."}},
@@ -80,7 +80,7 @@ async def observe_chat():
80
80
# website fetcher and dumper
81
81
custom_functions.append({
82
82
'name': 'get_website_dump',
83
-
'description': '[Use to fetch information from a specific website.] Fetches the content of a website using the lynx --dump command and returns the plain text output.',
83
+
'description': 'Browse a specific URL with Lynx and return its plain text page content. Use for URLs the user asks you to read or summarize, and to open relevant search results when their full content is needed.',
0 commit comments