initial commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# GoDeepSeek
|
||||
|
||||
## Requirements:
|
||||
- CGO enabled
|
||||
- x86_64 CPU with AVX2 (Intel Haswell 2013+, AMD Ryzen 2017+)
|
||||
- C++17 compiler (GCC 7+, Clang 5+, MSVC 2017+)
|
||||
|
||||
|
||||
## Quick start
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"deepseek"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
ds := deepseek.NewClient()
|
||||
ds.SetDeviceIDProvider(deepseek.RandomDeviceIDProvider())
|
||||
// Flow #1
|
||||
err := ds.Login("email", "password")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Flow #2
|
||||
ds.SetToken("TOKEN")
|
||||
|
||||
chatRes, err := ds.CreateChatWithContext(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
res, err := ds.CompletionWithContext(ctx, *deepseek.NewCompletionReq(chatRes.ID).SetPrompt("Hello"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
str, err := ds.ReadStreamAsString(ctx, res)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
log.Println(str)
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user