25 lines
306 B
Go
25 lines
306 B
Go
|
|
package agent
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"fmt"
|
||
|
|
"log"
|
||
|
|
|
||
|
|
"github.com/tmc/langchaingo/llms"
|
||
|
|
)
|
||
|
|
|
||
|
|
func Call(llm llms.Model, ctx context.Context) {
|
||
|
|
|
||
|
|
response, err := llms.GenerateFromSinglePrompt(
|
||
|
|
ctx,
|
||
|
|
llm,
|
||
|
|
"Hello! My name is wonder!",
|
||
|
|
)
|
||
|
|
if err != nil {
|
||
|
|
log.Fatal(err)
|
||
|
|
}
|
||
|
|
|
||
|
|
fmt.Println("AI:", response)
|
||
|
|
|
||
|
|
}
|