chore(type): update providers and claude hints (#766)
This commit is contained in:
parent
bdbbdec88c
commit
5c02a5d846
3
.github/workflows/ci.yaml
vendored
3
.github/workflows/ci.yaml
vendored
@ -32,6 +32,7 @@ jobs:
|
|||||||
rust-tests:
|
rust-tests:
|
||||||
name: Run Rust tests
|
name: Run Rust tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'push' || contains(github.event.pull_request.files.*.path, 'crates/') || contains(github.event.pull_request.files.*.path, '.cargo/')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
@ -44,6 +45,7 @@ jobs:
|
|||||||
rust:
|
rust:
|
||||||
name: Check Rust style
|
name: Check Rust style
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'push' || contains(github.event.pull_request.files.*.path, 'crates/') || contains(github.event.pull_request.files.*.path, '.cargo/')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
@ -56,6 +58,7 @@ jobs:
|
|||||||
rustlint:
|
rustlint:
|
||||||
name: Lint Rust
|
name: Lint Rust
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'push' || contains(github.event.pull_request.files.*.path, 'crates/') || contains(github.event.pull_request.files.*.path, '.cargo/')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
@ -2,6 +2,21 @@ local Utils = require("avante.utils")
|
|||||||
local Clipboard = require("avante.clipboard")
|
local Clipboard = require("avante.clipboard")
|
||||||
local P = require("avante.providers")
|
local P = require("avante.providers")
|
||||||
|
|
||||||
|
---@class AvanteClaudeBaseMessage
|
||||||
|
---@field cache_control {type: "ephemeral"}?
|
||||||
|
---
|
||||||
|
---@class AvanteClaudeTextMessage: AvanteClaudeBaseMessage
|
||||||
|
---@field type "text"
|
||||||
|
---@field text string
|
||||||
|
---
|
||||||
|
---@class AvanteClaudeImageMessage: AvanteClaudeBaseMessage
|
||||||
|
---@field type "image"
|
||||||
|
---@field source {type: "base64", media_type: string, data: string}
|
||||||
|
---
|
||||||
|
---@class AvanteClaudeMessage: AvanteBaseMessage
|
||||||
|
---@field role "user"
|
||||||
|
---@field content [AvanteClaudeTextMessage | AvanteClaudeImageMessage][]
|
||||||
|
|
||||||
---@class AvanteProviderFunctor
|
---@class AvanteProviderFunctor
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
@ -9,6 +24,7 @@ M.api_key_name = "ANTHROPIC_API_KEY"
|
|||||||
M.use_xml_format = true
|
M.use_xml_format = true
|
||||||
|
|
||||||
M.parse_message = function(opts)
|
M.parse_message = function(opts)
|
||||||
|
---@type AvanteClaudeMessage[]
|
||||||
local message_content = {}
|
local message_content = {}
|
||||||
|
|
||||||
if Clipboard.support_paste_image() and opts.image_paths then
|
if Clipboard.support_paste_image() and opts.image_paths then
|
||||||
|
@ -23,10 +23,6 @@ local DressingState = { winid = nil, input_winid = nil, input_bufnr = nil }
|
|||||||
---@field role "user" | "system"
|
---@field role "user" | "system"
|
||||||
---@field content string
|
---@field content string
|
||||||
---
|
---
|
||||||
---@class AvanteClaudeMessage: AvanteBaseMessage
|
|
||||||
---@field role "user"
|
|
||||||
---@field content {type: "text", text: string, cache_control?: {type: "ephemeral"}}[]
|
|
||||||
---
|
|
||||||
---@class AvanteGeminiMessage
|
---@class AvanteGeminiMessage
|
||||||
---@field role "user"
|
---@field role "user"
|
||||||
---@field parts { text: string }[]
|
---@field parts { text: string }[]
|
||||||
@ -75,16 +71,17 @@ local DressingState = { winid = nil, input_winid = nil, input_bufnr = nil }
|
|||||||
---@field setup fun(): nil
|
---@field setup fun(): nil
|
||||||
---@field has fun(): boolean
|
---@field has fun(): boolean
|
||||||
---@field api_key_name string
|
---@field api_key_name string
|
||||||
---@field tokenizer_id string | "gpt-4o"
|
---@field tokenizer_id [string] | "gpt-4o"
|
||||||
---@field use_xml_format boolean
|
---@field use_xml_format boolean
|
||||||
---@field model? string
|
---@field model? string
|
||||||
---@field parse_api_key fun(): string | nil
|
---@field parse_api_key fun(): string | nil
|
||||||
---@field parse_stream_data? AvanteStreamParser
|
---@field parse_stream_data? AvanteStreamParser
|
||||||
---@field on_error? fun(result: table): nil
|
---@field on_error? fun(result: table<string, any>): nil
|
||||||
---
|
---
|
||||||
---@class avante.Providers
|
---@class avante.Providers
|
||||||
---@field openai AvanteProviderFunctor
|
---@field openai AvanteProviderFunctor
|
||||||
---@field claude AvanteProviderFunctor
|
---@field claude AvanteProviderFunctor
|
||||||
|
---@field copilot AvanteProviderFunctor
|
||||||
---@field azure AvanteProviderFunctor
|
---@field azure AvanteProviderFunctor
|
||||||
---@field gemini AvanteProviderFunctor
|
---@field gemini AvanteProviderFunctor
|
||||||
---@field cohere AvanteProviderFunctor
|
---@field cohere AvanteProviderFunctor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user