Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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

})
Expand All @@ -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)
Expand Down