Skip to content

Commit 55811f3

Browse files
authored
docs: fix typos and update model references in chat model docs (#1507)
Signed-off-by: rogerogers <rogers@rogerogers.com>
1 parent ce65333 commit 55811f3

8 files changed

Lines changed: 212 additions & 206 deletions

File tree

content/en/docs/eino/ecosystem_integration/chat_model/chat_model_ark.md

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

content/en/docs/eino/ecosystem_integration/chat_model/chat_model_gemini.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func main() {
5858

5959
cm, err := gemini.NewChatModel(ctx, &gemini.Config{
6060
Client: client,
61-
Model: "gemini-1.5-flash",
61+
Model: "gemini-2.5-flash",
6262
ThinkingConfig: &genai.ThinkingConfig{
6363
IncludeThoughts: true,
6464
ThinkingBudget: nil,
@@ -68,7 +68,7 @@ func main() {
6868
log.Fatalf("NewChatModel of gemini failed, err=%v", err)
6969
}
7070

71-
// If you are using a model that supports image understanding (e.g., gemini-1.5-flash-image-preview),
71+
// If you are using a model that supports image understanding (e.g., gemini-2.5-flash-image),
7272
// you can provide both image and text input like this:
7373
/*
7474
image, err := os.ReadFile("./path/to/your/image.jpg")
@@ -129,7 +129,7 @@ type Config struct {
129129
Client *genai.Client
130130

131131
// Model specifies which Gemini model to use
132-
// Examples: "gemini-pro", "gemini-pro-vision", "gemini-1.5-flash"
132+
// Examples: "gemini-pro", "gemini-pro-vision", "gemini-2.5-flash"
133133
Model string
134134

135135
// MaxTokens limits the maximum number of tokens in the response
@@ -168,8 +168,8 @@ type Config struct {
168168

169169
// ResponseModalities specifies the modalities the model can return.
170170
// Optional.
171-
ResponseModalities []
172-
171+
ResponseModalities []gemini.GeminiResponseModality
172+
173173
MediaResolution genai.MediaResolution
174174

175175
// Cache controls prefix cache settings for the model.
@@ -194,6 +194,7 @@ This component supports two caching strategies to improve latency and reduce API
194194
- Implicit cache: Managed by Gemini itself. The service may automatically reuse previous requests or responses. Expiration and reuse are controlled by Gemini and cannot be configured.
195195

196196
The example below shows how to create a prefix cache and reuse it in subsequent calls.
197+
197198
```go
198199
toolInfoList := []*schema.ToolInfo{
199200
{

content/en/docs/eino/ecosystem_integration/chat_model/chat_model_openai.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -678,18 +678,18 @@ model, err := openai.NewChatModel(ctx, &openai.ChatModelConfig{
678678
Seed: &seed, // Random seed
679679
LogitBias: map[string]int{}, // Token bias
680680
User: &user, // User identifier
681-
681+
682682
ReasoningEffort:openai.ReasoningEffortLevelHigh, // Reasoning level, default "medium"
683-
683+
684684
Modalities: make([]openai.Modality, 0), // Model response modality types: ["text","audio"] default text
685-
685+
686686
Audio: &openai.Audio{ // Audio output parameters, required when modality includes audio
687687
Format: openai.AudioFormatMp3,
688688
Voice: openai.AudioVoiceAlloy,
689689
},
690-
690+
691691
ExtraFieldsmap[string]any{}, // Extra fields, will add or override request fields, used for experimental validation
692-
692+
693693
})
694694
```
695695

@@ -703,7 +703,7 @@ Conversation generation supports both normal mode and streaming mode:
703703
```go
704704
// Invoke mode
705705
response, err := model.Generate(ctx, messages)
706-
706+
707707
// Streaming mode
708708
stream, err := model.Stream(ctx, messages)
709709
```
@@ -729,7 +729,7 @@ imageStr := base64.StdEncoding.EncodeToString(image)
729729
messages := []*schema.Message{
730730
// System message
731731
schema.SystemMessage("You are an assistant"),
732-
732+
733733
// Multimodal message (with image)
734734
{
735735
Role: schema.User,
@@ -793,33 +793,33 @@ package main
793793
import (
794794
"context"
795795
"time"
796-
796+
797797
"github.com/cloudwego/eino-ext/components/model/openai"
798798
"github.com/cloudwego/eino/schema"
799799
)
800800

801801
func main() {
802802
ctx := context.Background()
803-
803+
804804
// Initialize model
805805
model, err := openai.NewChatModel(ctx, &openai.ChatModelConfig{
806806
APIKey: "your-api-key", // required
807807
Timeout: 30 * time.Second,
808808
Model: "gpt-4", // required
809-
809+
810810
// If the model supports audio generation and you need to generate audio, configure as follows
811811
// Modalities: []openai.Modality{openai.AudioModality, openai.TextModality},
812812
//Audio: &openai.Audio{
813813
// Format: openai.AudioFormatMp3,
814814
// Voice: openai.AudioVoiceAlloy,
815815
//},
816816
},
817-
817+
818818
})
819819
if err != nil {
820820
panic(err)
821821
}
822-
822+
823823
// Base64 format image data
824824
image, err := os.ReadFile("./examples/image/cat.png")
825825
if err != nil {
@@ -850,32 +850,32 @@ func main() {
850850
},
851851
},
852852
}
853-
853+
854854
// Generate response
855855
response, err := model.Generate(ctx, messages)
856856
if err != nil {
857857
panic(err)
858858
}
859-
859+
860860
// Process response
861861
/*
862-
The generated multimodal content is stored in the response.AssistantGentMultiContent field
862+
The generated multimodal content is stored in the response.AssistantGenMultiContent field
863863
In this example, the final generated message looks like:
864864
AssistantMessage = schema.Message{
865865
Role: schema.Assistant,
866866
AssistantGenMultiContent : []schema.MessageOutputPart{
867867
{Type: schema.ChatMessagePartTypeImageURL,
868868
Image: &schema.MessageOutputImage{
869869
MessagePartCommon: schema.MessagePartCommon{
870-
Base64Data: &DataStr,
870+
Base64Data: &DataStr,
871871
MIMEType: "image/png",
872872
},
873873
},
874874
},
875875
},
876876
}
877877
*/
878-
878+
879879
fmt.Printf("Assistant: %s\n", resp)
880880
}
881881
```
@@ -888,14 +888,14 @@ package main
888888
import (
889889
"context"
890890
"time"
891-
891+
892892
"github.com/cloudwego/eino-ext/components/model/openai"
893893
"github.com/cloudwego/eino/schema"
894894
)
895895

896896
func main() {
897897
ctx := context.Background()
898-
898+
899899
// Initialize model
900900
model, err := openai.NewChatModel(ctx, &openai.ChatModelConfig{
901901
APIKey: "your-api-key",
@@ -905,20 +905,20 @@ func main() {
905905
if err != nil {
906906
panic(err)
907907
}
908-
908+
909909
// Prepare messages
910910
messages := []*schema.Message{
911911
schema.SystemMessage("You are an assistant"),
912912
schema.UserMessage("Write a story"),
913913
}
914-
914+
915915
// Get streaming response
916916
reader, err := model.Stream(ctx, messages)
917917
if err != nil {
918918
panic(err)
919919
}
920920
defer reader.Close() // Remember to close
921-
921+
922922
// Process streaming content
923923
for {
924924
chunk, err := reader.Recv()

0 commit comments

Comments
 (0)