From 1078d4a1254cc8c3bbe39f5165976ffb04ea57e4 Mon Sep 17 00:00:00 2001 From: Adarsh Khare Date: Wed, 30 Jul 2025 21:00:08 -0700 Subject: [PATCH] Update README.md Fixed the sample code in Readme.md that has incorrect reference and unused imports. --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4a011e5..841b95f 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,13 @@ This is a simple example of how to use the library to create a simple chatbot that uses OpenAI to generate responses. ```go +package main + 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 +33,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 +52,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)