github sigoden/aichat v0.20.0-rc1

latest releases: v0.22.0, v0.22.0-rc3, v0.22.0-rc2...
pre-releaseone month ago

Patch Client API

AIChat supports patching request url, headers and body.

For example, we can patch claude:claude-3-5-sonnet-20240620 to use beta 8192 output tokens.

clients:
  - type: claude
    ...
    patch:                                # Patch api request
      chat_completions:                   # Api type, one of chat_completions, embeddings, and rerank
        'claude-3-5-sonnet-20240620':     # The regex to match model names, e.g. '.*' 'gpt-4o' 'gpt-4o|gpt-4-.*'
          headers:
            anthropic-beta: max-tokens-3-5-sonnet-2024-07-15
          body:
            max_tokens: 8192

More flexible using tools

AIChat introduces the use_tools configuration to manage which tools are included. This configuration works across global, role, session, and agent levels.
AIChat also introduces mapping_tools for managing aliases for a tool or toolset.

mapping_tools:
  fs: 'fs_cat,fs_ls,fs_mkdir,fs_rm,fs_write'
use_tools: 'execute_command,fs,send_email'

Configuration Changes

- buffer_editor: null
+ editor: null

- dangerously_functions_filter: null
- agents:
-   - name: todo
-     ...

The tool will request confirmation if the action is dangerous; the dangerously_functions_filter is unnecessary.

Each AI agent has its own config.yaml file; there is no need for a central agents configuration.

Enviroment Variables Changes

  • AIChat supports env file (<aichat-config-dir>/.env) for managing environment variables.

  • All config items have related environment variables to override their values.

    For example, we can use AICHAT_MODEL to override the default LLM and AICHAT_LIGHT_THEME to switch to light theme.

  • New env AICHAT_PATCH_{client}_CHAT_COMPLETIONS for patching chat completions api request url, headers and body.

    For example, set AICHAT_PATCH_OPENAI_CHAT_COMPLETIONS='{"gpt-4o":{"body":{"seed":666,"temperature":0}}}' to make gpt-4o more deterministic.

Client Changes

  • vertexai client supports cluade/mistral models, vertexai-claude client was abandoned.
  • bedrock client switch to converse api, supports llama3.1/mistral-large-v2/cohere.command-r models.
  • rag-dedicated client was abandoned, use openai-compatible client instead.

CLI Changes

-  -w, --wrap <WRAP>          Control text wrapping (no, auto, <max-width>)
-  -H, --no-highlight         Turn off syntax highlighting
-      --light-theme          Use light theme

Use environment variables AICHAT_WRAP, AICHAT_HIGHLIGHT and AICHAT_LIGHT_THEME instead.

New REPL Commands

.variable <name> <value>
.set stream false
.set use_tools <tools>

New Features

  • load env vars from file (#685)
  • enhenced flexibility for use tools (#688)
  • agent can reuse tools (#690)
  • support agent variables (#692)
  • --file/.file can load dirs (#693)
  • adjust the way of obtaining function call results (#695)
  • webui supports text to speech for messages (#712)
  • enhance logger (#731)
  • move agent config to separate file (#741)
  • webui add autofocus to chat-input in textarea (#742)
  • merge vertexai-cluade with vertexai (#745)
  • vertexai support mistral models (#746)
  • ollama support tools and new embeddings api (#748)
  • all config fields have related environment variables (#751)
  • bedrock client switch to converse api and support cohere models (#747)
  • support patching request url, headers and body (#756)
  • abandon rag_dedicated client and improve (#757)
  • abandon cli options --wrap, --no-highlight and --light-theme (#758)
  • add config.stream and .set stream repl command (#759)
  • ask for confirmation when some rag documents fail to load (#760)
  • export agent variable as LLM_AGENT_VAR_* (#766)
  • add agent-scoped agent_prelude config (#770)
  • rename config.buffer_editor to config.editor (#773)

Bug Fixes

  • .starter tab completion (#709)
  • webui input-panel exceeds viewpoint on mobile (#714)
  • problem with input token limit (#737)
  • invalid tool_calls of qianwen client (#740)
  • unable to rebuild agent rag (#763)

Don't miss a new aichat release

NewReleases is sending notifications on new releases.