Add runtime prompt values to module outputs
This commit is contained in:
@@ -35,9 +35,10 @@ type ConfigItem struct {
|
||||
}
|
||||
|
||||
type Output struct {
|
||||
ID ID `json:"id"`
|
||||
StanzaName string `json:"stanzaName"`
|
||||
Value any `json:"value"`
|
||||
ID ID `json:"id"`
|
||||
StanzaName string `json:"stanzaName"`
|
||||
Value any `json:"value"`
|
||||
PromptValue any `json:"-" yaml:"-"`
|
||||
}
|
||||
|
||||
type Snapshot struct {
|
||||
@@ -45,6 +46,13 @@ type Snapshot struct {
|
||||
Outputs []Output `json:"outputs"`
|
||||
}
|
||||
|
||||
func (o Output) DataPackageValue() any {
|
||||
if o.PromptValue != nil {
|
||||
return o.PromptValue
|
||||
}
|
||||
return o.Value
|
||||
}
|
||||
|
||||
func NewSnapshot(outputs []Output) (Snapshot, error) {
|
||||
snapshot := Snapshot{
|
||||
SchemaVersion: SnapshotSchemaVersion,
|
||||
|
||||
Reference in New Issue
Block a user