Skip to content

Commit b4c925d

Browse files
fix(eino): optimize lambda comment (#1425)
1 parent 0d1d85e commit b4c925d

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

content/en/docs/eino/core_modules/components/lambda_guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ From the perspective of the unified specification of Eino's component interface,
5252
- InvokableLambda
5353

5454
```go
55-
// input and output types are any types customized by oneself.
55+
// The types of input and output types can be any types.
5656
lambda := compose.InvokableLambda(func(ctx context.Context, input string) (output string, err error) {
5757
// some logic
5858
})
@@ -61,7 +61,7 @@ lambda := compose.InvokableLambda(func(ctx context.Context, input string) (outpu
6161
- StreamableLambda
6262

6363
```go
64-
// The types of 'input' and 'output' are any custom types.
64+
// The type of input can be any custom type and the type of output must be *schema.StreamReader[O],O can be any type.
6565
lambda := compose.StreamableLambda(func(ctx context.Context, input string) (output *schema.StreamReader[string], err error) {
6666
// some logic
6767
})
@@ -70,7 +70,7 @@ lambda := compose.StreamableLambda(func(ctx context.Context, input string) (outp
7070
- CollectableLambda
7171

7272
```go
73-
// The types of 'input' and 'output' can be any custom type.
73+
// The type of input must be *schema.StreamReader[I],I can be any type and the type of output can be any custom type.
7474
lambda := compose.CollectableLambda(func(ctx context.Context, input *schema.StreamReader[string]) (output string, err error) {
7575
// some logic
7676
})
@@ -79,7 +79,7 @@ lambda := compose.CollectableLambda(func(ctx context.Context, input *schema.Stre
7979
- TransformableLambda
8080

8181
```go
82-
// The types of input and output are any custom types.
82+
// The type of input must be *schema.StreamReader[I],I can be any type and the type of output must be *schema.StreamReader[O],O can be any type.
8383
lambda := compose.TransformableLambda(func(ctx context.Context, input *schema.StreamReader[string]) (output *schema.StreamReader[string], err error) {
8484
// some logic
8585
})

content/zh/docs/eino/core_modules/components/lambda_guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ lambda := compose.InvokableLambda(func(ctx context.Context, input string) (outpu
6464
- StreamableLambda
6565

6666
```go
67-
// input 可以是任意类型output 必须是 *schema.StreamReader[O],其中 O 可以是任意类型
67+
// input 可以是任意类型output 必须是 *schema.StreamReader[O],其中 O 可以是任意类型
6868
lambda := compose.StreamableLambda(func(ctx context.Context, input string) (output *schema.StreamReader[string], err error) {
6969
// some logic
7070
})
@@ -73,7 +73,7 @@ lambda := compose.StreamableLambda(func(ctx context.Context, input string) (outp
7373
- CollectableLambda
7474

7575
```go
76-
// input 必须是 *schema.StreamReader[I],其中 I 可以是任意类型output 可以是任意类型
76+
// input 必须是 *schema.StreamReader[I],其中 I 可以是任意类型output 可以是任意类型
7777
lambda := compose.CollectableLambda(func(ctx context.Context, input *schema.StreamReader[string]) (output string, err error) {
7878
// some logic
7979
})
@@ -82,7 +82,7 @@ lambda := compose.CollectableLambda(func(ctx context.Context, input *schema.Stre
8282
- TransformableLambda
8383

8484
```go
85-
// input output 必须是 *schema.StreamReader[I],其中 I 可以是任意类型
85+
// input 必须是 *schema.StreamReader[I],其中 I 可以是任意类型;output 必须是 *schema.StreamReader[O],其中 O 可以是任意类型
8686
lambda := compose.TransformableLambda(func(ctx context.Context, input *schema.StreamReader[string]) (output *schema.StreamReader[string], err error) {
8787
// some logic
8888
})

0 commit comments

Comments
 (0)