Skip to content

Commit 36267de

Browse files
committed
v0.8.0
1 parent 80dfb6a commit 36267de

5 files changed

Lines changed: 851 additions & 386 deletions

File tree

README.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,75 @@ If you run into any issues, consult the logs or reach out on the repository's [I
240240
---
241241

242242
# Changelog
243-
243+
- v0.8.0 - OpenAI 5.x-era cleanup + Perplexity/DuckDuckGo compatibility hardening
244+
- Refactored `src/api_perplexity_search.py` for the current Perplexity/Sonar API workflow.
245+
- Kept Perplexity on the OpenAI-compatible Chat Completions endpoint by default:
246+
- `https://api.perplexity.ai/chat/completions`
247+
- Added configurable Perplexity endpoint support via `[Perplexity] -> Endpoint`.
248+
- Kept `sonar` as the default Perplexity model.
249+
- Added safer Perplexity config loading helpers:
250+
- `_cfg_get()`
251+
- `_cfg_getint()`
252+
- `_cfg_getfloat()`
253+
- Added explicit Perplexity API key validation for `PERPLEXITY_API_KEY`.
254+
- Added clearer Perplexity error returns for:
255+
- missing API key
256+
- empty question
257+
- bad/non-JSON response
258+
- HTTP errors
259+
- exhausted retries
260+
- Hardened Perplexity retry handling:
261+
- retryable HTTP status detection
262+
- timeout handling
263+
- request-error handling
264+
- exponential backoff with jitter
265+
- Added safer Perplexity response parsing through `_extract_perplexity_content()`.
266+
- Preserved old public Perplexity helper names/signatures so existing imports keep working:
267+
- `fact_check_with_perplexity()`
268+
- `query_perplexity()`
269+
- `smart_chunk()`
270+
- `rejoin_chunks()`
271+
- `format_headers_for_telegram()`
272+
- `markdown_to_html()`
273+
- `sanitize_urls()`
274+
- `split_message()`
275+
- `send_split_messages()`
276+
- `handle_long_response()`
277+
- `detect_language()`
278+
- Updated Perplexity-side `detect_language()` helper for newer OpenAI model payload rules:
279+
- no `temperature` for non-GPT-4-family models
280+
- `max_completion_tokens` for newer non-GPT-4-family models
281+
- `max_tokens` retained for GPT-4-family models
282+
- Removed stale hardcoded `gpt-4o-mini` fallback from Perplexity language detection.
283+
- Updated language detection fallback model handling to use the configured default model instead of old dead model names.
284+
- Refactored `src/api_get_duckduckgo_search.py` for modern OpenAI tool-calling compatibility.
285+
- Updated DuckDuckGo sub-agent browsing away from legacy-only `functions` / `function_call` handling.
286+
- Added modern OpenAI `tools` / `tool_choice` payload support for the DuckDuckGo sub-agent.
287+
- Added backward-compatible parsing for both:
288+
- modern `tool_calls`
289+
- legacy `function_call`
290+
- Added safer DuckDuckGo sub-agent response extraction to avoid brittle direct `choices[0]["message"]["content"]` assumptions.
291+
- Updated DuckDuckGo sub-agent model payload rules for newer OpenAI models:
292+
- GPT-4-family models may receive `temperature`
293+
- newer non-GPT-4-family models omit `temperature`
294+
- newer non-GPT-4-family models use `max_completion_tokens`
295+
- GPT-4-family models keep `max_tokens`
296+
- Updated DuckDuckGo default fallback model from old `gpt-4` assumptions to the newer configured model path / GPT-5.x-era default.
297+
- Kept DuckDuckGo search behavior compatible with non-agentic mode:
298+
- raw DuckDuckGo/lynx result fetching still works without invoking the sub-agent
299+
- duplicate links are filtered
300+
- DuckDuckGo redirect URLs are decoded back into original URLs
301+
- Hardened DuckDuckGo agentic browsing fallback behavior:
302+
- if the sub-agent returns empty output, raw DuckDuckGo results are returned
303+
- if webpage fetching fails, raw DuckDuckGo results are returned
304+
- if OpenAI sub-agent calls fail after retries, raw DuckDuckGo results are returned
305+
- Improved `lynx` webpage dump handling for DuckDuckGo agentic browsing.
306+
- Preserved configurable content-size limiting for fetched webpages:
307+
- `[DuckDuckGo] -> EnableContentSizeLimit`
308+
- `[DuckDuckGo] -> MaxContentSize`
309+
- Improved Telegram HTML formatting safety in DuckDuckGo search output.
310+
- Removed more stale pre-5.x OpenAI assumptions from auxiliary helper modules.
311+
- General cleanup of old compatibility corpse-code around model defaults, token-limit parameters, and function/tool-call parsing.
244312
- v0.77.1 - OpenAI newer model (5.x series) / tools compatibility update
245313
- Added support for modern OpenAI Chat Completions tool calling via `tools` / `tool_choice` / `tool_calls`.
246314
- Added backward-compatible parsing for both modern `tool_calls` and legacy `function_call` responses.

config/config.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ ShowPastRemindersCount = 10
202202
# Perplexity API
203203
# ~~~~~~~~~~~~~~~
204204
[Perplexity]
205+
# Enable or disable Perplexity API function/tool exposure.
206+
# Default should be False because Perplexity may require paid credits.
207+
Enabled = False
208+
205209
# Model name to use with Perplexity API
206210
Model = sonar
207211

0 commit comments

Comments
 (0)