mirror of
https://github.com/fumiama/deepinfra.git
synced 2026-06-05 00:32:46 +08:00
doc: update README
This commit is contained in:
15
README.md
15
README.md
@@ -3,13 +3,24 @@ Lightweight OpenAI/OLLaMA/GenAI compatible caller, originally designed for DeepI
|
|||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
```go
|
```go
|
||||||
api := NewAPI(OpenAIDeepInfra, "PUT YOUR API KEY HERE")
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/fumiama/deepinfra"
|
||||||
|
"github.com/fumiama/deepinfra/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
api := deepinfra.NewAPI(deepinfra.OpenAIDeepInfra, "PUT YOUR API KEY HERE")
|
||||||
txt, err := api.Request(model.NewOpenAI(model.ModelDeepDeek, model.SeparatorThink, 0.7, 0.9, 1024).
|
txt, err := api.Request(model.NewOpenAI(model.ModelDeepDeek, model.SeparatorThink, 0.7, 0.9, 1024).
|
||||||
System("Be a good assistant.").User("Hello"),
|
System("Be a good assistant.").User(model.NewContentText("Hello")),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
fmt.Println(txt)
|
fmt.Println(txt)
|
||||||
// Hello! How can I assist you today?
|
// Hello! How can I assist you today?
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user