From cbe853c30fd1fdaf6a77ebd24150bc24cb9c611e Mon Sep 17 00:00:00 2001 From: Selwyn McCracken Date: Sat, 12 Oct 2024 16:52:56 +1300 Subject: [PATCH] Fix README example fix the example in the readme to run - replaced `schema.` references to `llms.` (as in graph/graph_test.go). --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4a011e5..9cd8708 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,10 @@ This is a simple example of how to use the library to create a simple chatbot th ```go import ( "context" - "errors" "fmt" - "testing" "github.com/tmc/langchaingo/llms" "github.com/tmc/langchaingo/llms/openai" - "github.com/tmc/langchaingo/schema" "github.com/tmc/langgraphgo/graph" ) @@ -35,7 +32,7 @@ func main() { return nil, err } return append(state, - llms.TextParts(schema.ChatMessageTypeAI, r.Choices[0].Content), + llms.TextParts(llms.ChatMessageTypeAI, r.Choices[0].Content), ), nil }) @@ -54,7 +51,7 @@ func main() { ctx := context.Background() // Let's run it! res, err := runnable.Invoke(ctx, []llms.MessageContent{ - llms.TextParts(schema.ChatMessageTypeHuman, "What is 1 + 1?"), + llms.TextParts(llms.ChatMessageTypeHuman, "What is 1 + 1?"), }) if err != nil { panic(err)