sdk

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 26 Imported by: 0

README

智元 Fast API SDK

Release License Go Report Card

智元 Fast API 是一站式API管理系统,将各类LLM API进行统一格式、统一规范、统一管理,使其在功能、性能和用户体验上达到极致。

功能介绍

智元 Fast API SDK 模块, 主要集成各类 LLM API 的能力

支持模型

公司 Completion Image Audio Multimodal Realtime Embedding Moderation
OpenAI ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Azure ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
百度 ✔️
科大讯飞 ✔️ ✔️
阿里云 ✔️
智谱AI ✔️
Google ✔️ ✔️
DeepSeek ✔️
360智脑 ✔️
Midjourney ✔️
Anthropic ✔️ ✔️
GCPClaude ✔️ ✔️
AWSClaude ✔️ ✔️

项目预览

专业版预览

公益站点

项目截图

管理端

dashboard model key modelagent user chat

用户端

dashboard mymodel app appkey chat

开源地址

仓库 API Web Admin SDK
主库 fastapi fastapi-web fastapi-admin fastapi-sdk
码云 fastapi fastapi-web fastapi-admin fastapi-sdk

作者

作者

交流群

交流群

Star History Chart

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.5.0

type Client interface {
	ChatCompletion(ctx context.Context, request model.ChatCompletionRequest) (res model.ChatCompletionResponse, err error)
	ChatCompletionStream(ctx context.Context, request model.ChatCompletionRequest) (responseChan chan *model.ChatCompletionResponse, err error)
	Image(ctx context.Context, request model.ImageRequest) (res model.ImageResponse, err error)
	Speech(ctx context.Context, request model.SpeechRequest) (res model.SpeechResponse, err error)
	Transcription(ctx context.Context, request model.AudioRequest) (res model.AudioResponse, err error)
	Embeddings(ctx context.Context, request model.EmbeddingRequest) (res model.EmbeddingResponse, err error)
	Moderations(ctx context.Context, request model.ModerationRequest) (res model.ModerationResponse, err error)
}

func NewClient

func NewClient(ctx context.Context, corp, model, key, baseURL, path string, isSupportSystemRole *bool, proxyURL ...string) Client

type EmbeddingClient added in v0.4.0

type EmbeddingClient struct {
	// contains filtered or unexported fields
}

func NewEmbeddingClient added in v0.4.0

func NewEmbeddingClient(ctx context.Context, model, key, baseURL, path string, proxyURL ...string) *EmbeddingClient

func (*EmbeddingClient) Embeddings added in v0.4.0

func (c *EmbeddingClient) Embeddings(ctx context.Context, request model.EmbeddingRequest) (res model.EmbeddingResponse, err error)

type MidjourneyClient added in v0.4.0

type MidjourneyClient struct {
	// contains filtered or unexported fields
}

func NewMidjourneyClient added in v0.4.0

func NewMidjourneyClient(ctx context.Context, baseURL, path, apiSecret, apiSecretHeader, method string, proxyURL ...string) *MidjourneyClient

func (*MidjourneyClient) Request added in v0.4.0

func (c *MidjourneyClient) Request(ctx context.Context, data interface{}) (res model.MidjourneyResponse, err error)

type ModerationClient added in v0.5.0

type ModerationClient struct {
	// contains filtered or unexported fields
}

func NewModerationClient added in v0.5.0

func NewModerationClient(ctx context.Context, model, key, baseURL, path string, proxyURL ...string) *ModerationClient

func (*ModerationClient) Moderations added in v0.5.0

func (c *ModerationClient) Moderations(ctx context.Context, request model.ModerationRequest) (res model.ModerationResponse, err error)

type RealtimeClient added in v0.5.0

type RealtimeClient struct {
	// contains filtered or unexported fields
}

func NewRealtimeClient added in v0.5.0

func NewRealtimeClient(ctx context.Context, model, key, baseURL, path string, proxyURL ...string) *RealtimeClient

func (*RealtimeClient) Realtime added in v0.5.0

func (c *RealtimeClient) Realtime(ctx context.Context, requestChan chan *model.RealtimeRequest) (responseChan chan *model.RealtimeResponse, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL