refactor(ai): use base url for endpoint config

Change endpoint configuration to use base URL pattern,
automatically appending /chat/completions path.

- Update default endpoint to base URL format
- Add automatic path construction in strategy
- Update README examples to use base URLs
- Update endpoint description to "base URL"

Follows OpenAI SDK standard pattern where users configure
base URL and library appends specific paths.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Frad LEE 2026-02-05 11:25:31 +08:00
commit f43786cafd
4 changed files with 11 additions and 9 deletions

View file

@ -95,9 +95,9 @@ typeset -g ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig-
typeset -g ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME=zsh_autosuggest_completion_pty
# AI strategy configuration
# API endpoint for AI suggestions (OpenAI-compatible)
# API base URL for AI suggestions (OpenAI-compatible)
(( ! ${+ZSH_AUTOSUGGEST_AI_ENDPOINT} )) &&
typeset -g ZSH_AUTOSUGGEST_AI_ENDPOINT='https://api.openai.com/v1/chat/completions'
typeset -g ZSH_AUTOSUGGEST_AI_ENDPOINT='https://api.openai.com/v1'
# AI model to use for suggestions
(( ! ${+ZSH_AUTOSUGGEST_AI_MODEL} )) &&