Pipeline class - start()
- TypeScript
- Python
The Pipeline
class is the main entry point for passing observability data to Gentrace. start()
is a method under this class. Learn more about using pipelines here.
Example
typescript
import {init ,Pipeline } from "@gentrace/core";init ({apiKey :process .env .GENTRACE_API_KEY })constpipeline = newPipeline ({slug : "example-pipeline"});construnner =pipeline .start ();// runner is a PipelineRun instance
python
import osimport gentracegentrace.init(api_key=os.environ["GENTRACE_API_KEY"])pipeline = gentrace.Pipeline(slug="example-pipeline")runner = pipeline.start()# runner is a PipelineRun instance
start()
The start()
method instantiates a new PipelineRun
. A pipeline run captures all steps in that generative pipeline.
Arguments
context: PipelineContext
The context
argument is an object that contains the context for the PipelineRun
. This context is associated with all
steps in the generative pipeline. The object is represented by the PipelineContext
type.
Read more about the PipelineContext
types here.
Return value
The start()
method returns a PipelineRun
class instance. Read more about the PipelineRun
class here.