mirror of
				https://github.com/songquanpeng/one-api.git
				synced 2025-11-04 15:53:42 +08:00 
			
		
		
		
	feat: support claude and gemini in vertex ai (#1621)
* feat: support claude and gemini in vertex ai * fix: do not show api key field in channel page when the type is VertexAI * fix: update getToken function to include channelId in cache key
This commit is contained in:
		@@ -3,6 +3,7 @@ package model
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
 | 
			
		||||
	"github.com/songquanpeng/one-api/common/config"
 | 
			
		||||
	"github.com/songquanpeng/one-api/common/helper"
 | 
			
		||||
	"github.com/songquanpeng/one-api/common/logger"
 | 
			
		||||
@@ -39,13 +40,15 @@ type Channel struct {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type ChannelConfig struct {
 | 
			
		||||
	Region     string `json:"region,omitempty"`
 | 
			
		||||
	SK         string `json:"sk,omitempty"`
 | 
			
		||||
	AK         string `json:"ak,omitempty"`
 | 
			
		||||
	UserID     string `json:"user_id,omitempty"`
 | 
			
		||||
	APIVersion string `json:"api_version,omitempty"`
 | 
			
		||||
	LibraryID  string `json:"library_id,omitempty"`
 | 
			
		||||
	Plugin     string `json:"plugin,omitempty"`
 | 
			
		||||
	Region            string `json:"region,omitempty"`
 | 
			
		||||
	SK                string `json:"sk,omitempty"`
 | 
			
		||||
	AK                string `json:"ak,omitempty"`
 | 
			
		||||
	UserID            string `json:"user_id,omitempty"`
 | 
			
		||||
	APIVersion        string `json:"api_version,omitempty"`
 | 
			
		||||
	LibraryID         string `json:"library_id,omitempty"`
 | 
			
		||||
	Plugin            string `json:"plugin,omitempty"`
 | 
			
		||||
	VertexAIProjectID string `json:"vertex_ai_project_id,omitempty"`
 | 
			
		||||
	VertexAIADC       string `json:"vertex_ai_adc,omitempty"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func GetAllChannels(startIdx int, num int, scope string) ([]*Channel, error) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user