mirror of
https://github.com/fumiama/deepinfra.git
synced 2026-06-05 00:32:46 +08:00
71569e85d50348446bc383bf472640c537c9f04c
deepinfra
Call OpenAI compatible APIs, originally designed for DeepInfra.
Quick Start
api := NewAPI(APIDeepInfra, "PUT YOUR API KEY HERE")
txt, err := api.Request(model.NewDeepSeek(0.7, 0.9, 1024).
System("Be a good assistant.").User("Hello"),
)
if err != nil {
panic(err)
}
fmt.Println(txt)
// Hello! How can I assist you today?
Custom Call
api := NewAPI(APIDeepInfra, "PUT YOUR API KEY HERE")
txt, err := api.Request(model.NewCustom("fumiama/ninus", "", 0.7, 0.9, 1024).
System("你正在QQ群与用户聊天,用户发送了消息。按自己的心情简短思考后,条理清晰地回应**一句话**,禁止回应多句。").
User("总不能什么都查吧").User("后面DOGE就成恶龙了 很常见的场景"),
)
if err != nil {
panic(err)
}
fmt.Println(txt)
// 要不我给你查一下?
Description
Lightweight OpenAI/OLLaMA/GenAI compatible caller, originally designed for DeepInfra.
gemini-apigenaigenai-apigolanggolang-cligolang-librarygolang-packagegolang-toolsgoogle-generative-aiollamaollama-apiollama-clientopenaiopenai-apiopenaiapi
Readme
AGPL-3.0
86 KiB
Languages
Go
100%