mirror of
https://github.com/vxcontrol/langchaingo.git
synced 2026-07-21 08:55:25 -04:00
8d4c17fc73
* chore: use slices and maps packages * chore: skip embedded type * chore: use fmt.Fprint instead * chore: use switch * chore: reorder imports * chore: add white lines * chore: use t.Setenv * chore: excplicitly omit non used param * chore: use t.TempDir * chore: use maps package * chore: migrate golangci-lint config file Run: "golangci-lint migrate -c .golangci.yaml --skip-validation" * chore: bump golangci-lint action to v7
31 lines
468 B
Go
31 lines
468 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/tmc/langchaingo/llms/maritaca"
|
|
)
|
|
|
|
func main() {
|
|
token := os.Getenv("MARITACA_KEY")
|
|
|
|
opts := []maritaca.Option{
|
|
maritaca.WithToken(token),
|
|
maritaca.WithModel("sabia-2-medium"),
|
|
}
|
|
llm, err := maritaca.New(opts...)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
prompt := "How many people live in Brazil?"
|
|
|
|
resp, err := llm.Call(context.Background(), prompt)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(resp)
|
|
}
|