Remove prompt version selectors
This commit is contained in:
@@ -286,7 +286,7 @@ func (state *loaded) readContent(fieldPath configkit.Path, name string, lookupOr
|
||||
return string(content), nil
|
||||
}
|
||||
|
||||
func (state *loaded) lookupPromptEntry(id, version string) (*promptEntry, error) {
|
||||
func (state *loaded) lookupPromptEntry(id string) (*promptEntry, error) {
|
||||
if state == nil || strings.TrimSpace(id) == "" {
|
||||
return nil, errPromptNotFound
|
||||
}
|
||||
@@ -322,7 +322,7 @@ func promptLookupError(err error) error {
|
||||
}
|
||||
|
||||
func (state *loaded) prompt(id string) (*domain.PromptDefinition, domain.PromptInspection, error) {
|
||||
entry, err := state.lookupPromptEntry(id, "")
|
||||
entry, err := state.lookupPromptEntry(id)
|
||||
if err != nil {
|
||||
return nil, domain.PromptInspection{}, err
|
||||
}
|
||||
@@ -330,13 +330,12 @@ func (state *loaded) prompt(id string) (*domain.PromptDefinition, domain.PromptI
|
||||
}
|
||||
|
||||
// GetPromptSnapshot returns an independently owned captured definition and its
|
||||
// construction-time hash. The version argument is retained temporarily at the
|
||||
// adapter boundary and does not participate in lookup.
|
||||
func (state *loaded) GetPromptSnapshot(ctx context.Context, id, version string) (*domain.PromptDefinition, string, error) {
|
||||
// construction-time hash.
|
||||
func (state *loaded) GetPromptSnapshot(ctx context.Context, id string) (*domain.PromptDefinition, string, error) {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
entry, err := state.lookupPromptEntry(id, version)
|
||||
entry, err := state.lookupPromptEntry(id)
|
||||
if err != nil {
|
||||
return nil, "", promptLookupError(err)
|
||||
}
|
||||
@@ -345,11 +344,11 @@ func (state *loaded) GetPromptSnapshot(ctx context.Context, id, version string)
|
||||
|
||||
// GetPromptInspection returns an independently owned inspection of one
|
||||
// captured prompt without copying its execution templates.
|
||||
func (state *loaded) GetPromptInspection(ctx context.Context, id, version string) (*domain.PromptInspection, error) {
|
||||
func (state *loaded) GetPromptInspection(ctx context.Context, id string) (*domain.PromptInspection, error) {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
entry, err := state.lookupPromptEntry(id, version)
|
||||
entry, err := state.lookupPromptEntry(id)
|
||||
if err != nil {
|
||||
return nil, promptLookupError(err)
|
||||
}
|
||||
@@ -357,13 +356,13 @@ func (state *loaded) GetPromptInspection(ctx context.Context, id, version string
|
||||
}
|
||||
|
||||
// GetPromptDefinition implements the runner's prompt lookup boundary.
|
||||
func (state *loaded) GetPromptDefinition(ctx context.Context, id, version string) (*domain.PromptDefinition, error) {
|
||||
definition, _, err := state.GetPromptSnapshot(ctx, id, version)
|
||||
func (state *loaded) GetPromptDefinition(ctx context.Context, id string) (*domain.PromptDefinition, error) {
|
||||
definition, _, err := state.GetPromptSnapshot(ctx, id)
|
||||
return definition, err
|
||||
}
|
||||
|
||||
// GetCompiledTemplates returns construction-time parses for one prompt ID.
|
||||
func (state *loaded) GetCompiledTemplates(id, version string) (prompt.CompiledTemplates, bool) {
|
||||
func (state *loaded) GetCompiledTemplates(id string) (prompt.CompiledTemplates, bool) {
|
||||
if state == nil {
|
||||
return prompt.CompiledTemplates{}, false
|
||||
}
|
||||
@@ -377,7 +376,7 @@ func (state *loaded) GetCompiledTemplates(id, version string) (prompt.CompiledTe
|
||||
// GetRequirementSnapshot returns captured templates and input metadata for
|
||||
// one prompt ID. Returned metadata and slices are independently
|
||||
// owned; the compiled templates are shared immutable construction-time parses.
|
||||
func (state *loaded) GetRequirementSnapshot(id, version string) (prompt.RequirementSnapshot, bool) {
|
||||
func (state *loaded) GetRequirementSnapshot(id string) (prompt.RequirementSnapshot, bool) {
|
||||
if state == nil {
|
||||
return prompt.RequirementSnapshot{}, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user