-
Notifications
You must be signed in to change notification settings - Fork 611
feat(go): Add cancelAction and early trace ID to headers in go reflection server #3885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
7b16af0
8e95289
fff7c7a
ee91557
fd87aad
1fba819
7108889
0c1b223
e85a455
1768fef
018e213
4fb0946
0ec1967
022290b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,10 @@ type ActionRunResult[T any] struct { | |
| SpanId string | ||
| } | ||
|
|
||
| // TelemetryCallback is called when telemetry information becomes available. | ||
| // It receives the trace ID and span ID as soon as the span is created. | ||
| type TelemetryCallback func(traceID, spanID string) | ||
|
|
||
| // Action is the interface that all Genkit primitives (e.g. flows, models, tools) have in common. | ||
| type Action interface { | ||
| Registerable | ||
|
|
@@ -35,7 +39,8 @@ type Action interface { | |
| // RunJSON runs the action with the given JSON input and streaming callback and returns the output as JSON. | ||
| RunJSON(ctx context.Context, input json.RawMessage, cb func(context.Context, json.RawMessage) error) (json.RawMessage, error) | ||
| // RunJSONWithTelemetry runs the action with the given JSON input and streaming callback and returns the output as JSON along with telemetry info. | ||
| RunJSONWithTelemetry(ctx context.Context, input json.RawMessage, cb func(context.Context, json.RawMessage) error) (*ActionRunResult[json.RawMessage], error) | ||
| // The telemetryCb callback, if provided, is called as soon as the trace span is created with the trace ID and span ID. | ||
| RunJSONWithTelemetry(ctx context.Context, input json.RawMessage, cb func(context.Context, json.RawMessage) error, telemetryCb TelemetryCallback) (*ActionRunResult[json.RawMessage], error) | ||
|
||
| // Desc returns a descriptor of the action. | ||
| Desc() ActionDesc | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.