Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/ai/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func DefineBatchEvaluator(r api.Registry, name string, opts *EvaluatorOptions, f
// LookupEvaluator looks up an [Evaluator] registered by [DefineEvaluator].
// It returns nil if the evaluator was not defined.
func LookupEvaluator(r api.Registry, name string) Evaluator {
action := core.LookupActionFor[*EvaluatorRequest, *EvaluatorResponse, struct{}](r, api.ActionTypeEvaluator, name)
action := core.ResolveActionFor[*EvaluatorRequest, *EvaluatorResponse, struct{}](r, api.ActionTypeEvaluator, name)
if action == nil {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion go/ai/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func DefinePrompt(r api.Registry, name string, opts ...PromptOption) Prompt {
// LookupPrompt looks up a [Prompt] registered by [DefinePrompt].
// It returns nil if the prompt was not defined.
func LookupPrompt(r api.Registry, name string) Prompt {
action := core.LookupActionFor[any, *GenerateActionOptions, struct{}](r, api.ActionTypeExecutablePrompt, name)
action := core.ResolveActionFor[any, *GenerateActionOptions, struct{}](r, api.ActionTypeExecutablePrompt, name)
if action == nil {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion go/ai/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func FindMatchingResource(r api.Registry, uri string) (Resource, *ResourceInput,

// LookupResource looks up the resource in the registry by provided name and returns it.
func LookupResource(r api.Registry, name string) Resource {
action := core.LookupActionFor[*ResourceInput, *ResourceOutput, struct{}](r, api.ActionTypeResource, name)
action := core.ResolveActionFor[*ResourceInput, *ResourceOutput, struct{}](r, api.ActionTypeResource, name)
if action == nil {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion go/ai/retriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func DefineRetriever(r api.Registry, name string, opts *RetrieverOptions, fn Ret
// It will try to resolve the retriever dynamically if the retriever is not found.
// It returns nil if the retriever was not resolved.
func LookupRetriever(r api.Registry, name string) Retriever {
action := core.LookupActionFor[*RetrieverRequest, *RetrieverResponse, struct{}](r, api.ActionTypeRetriever, name)
action := core.ResolveActionFor[*RetrieverRequest, *RetrieverResponse, struct{}](r, api.ActionTypeRetriever, name)
if action == nil {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion go/ai/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func LookupTool(r api.Registry, name string) Tool {
}
provider, id := api.ParseName(name)
key := api.NewKey(api.ActionTypeTool, provider, id)
action := r.LookupAction(key)
action := r.ResolveAction(key)
if action == nil {
return nil
}
Expand Down
2 changes: 2 additions & 0 deletions go/core/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ func ResolveActionFor[In, Out, Stream any](r api.Registry, atype api.ActionType,
// LookupActionFor returns the action for the given key in the global registry,
// or nil if there is none.
// It panics if the action is of the wrong api.
//
// Deprecated: Use ResolveActionFor.
func LookupActionFor[In, Out, Stream any](r api.Registry, atype api.ActionType, name string) *ActionDef[In, Out, Stream] {
provider, id := api.ParseName(name)
key := api.NewKey(atype, provider, id)
Expand Down
Loading