From 4cae0e2937b51938ae52172bf14f406863d2ba95 Mon Sep 17 00:00:00 2001 From: Copito <6876182+copito@users.noreply.github.com> Date: Sat, 20 Dec 2025 12:05:10 -0600 Subject: [PATCH 1/2] Update import paths and message types in README - Removed unused imports - ChatMessageType is located in llms.ChatMessageType --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4a011e5..1621c8f 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) @@ -63,6 +60,6 @@ func main() { fmt.Println(res) // Output: - // [{human [{What is 1 + 1?}]} {ai [{1 + 1 equals 2.}]}] + // [{human [What is 1 + 1?]} {ai [The answer to 1 + 1 is... 2!]}] } ``` From 2c059f17cbd82162967d5d9f58638531ac5b2d40 Mon Sep 17 00:00:00 2001 From: Copito <6876182+copito@users.noreply.github.com> Date: Sat, 20 Dec 2025 12:06:51 -0600 Subject: [PATCH 2/2] :memo: adding package --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1621c8f..ab5b4f6 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ 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" "fmt"