API: Sinks
This section covers the BaseOutputSink
and the built-in sink implementations for handling tool outputs.
safeagent.sinks
BaseOutputSink
Abstract base class for all tool output sinks.
Source code in src/safeagent/sinks.py
8 9 10 11 12 13 14 15 16 17 18 |
|
handle(tool_name, result, run_id, **kwargs)
Processes the tool's result. Must be implemented by subclasses. Should return a dictionary with metadata about the sink operation.
Source code in src/safeagent/sinks.py
10 11 12 13 14 15 |
|
FileOutputSink
Bases: BaseOutputSink
An output sink that saves the tool's result to a local JSON file.
Source code in src/safeagent/sinks.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
PubSubSink
Bases: BaseOutputSink
A conceptual output sink for Google Cloud Pub/Sub.
Source code in src/safeagent/sinks.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|