internal/mcp: rename Make* to New*
Change-Id: I8d3d2ca125b7c24dd265937c4fe910ea823ab811 Reviewed-on: https://go-review.googlesource.com/c/tools/+/670537 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
9031106300
commit
e0e304e51e
1 changed files with 32 additions and 32 deletions
|
|
@ -25,7 +25,7 @@ type Prompt struct {
|
|||
Handler PromptHandler
|
||||
}
|
||||
|
||||
// MakePrompt is a helper to use reflection to create a prompt for the given
|
||||
// NewPrompt is a helper to use reflection to create a prompt for the given
|
||||
// handler.
|
||||
//
|
||||
// The arguments for the prompt are extracted from the request type for the
|
||||
|
|
@ -33,7 +33,7 @@ type Prompt struct {
|
|||
// of type string or *string. The argument names for the resulting prompt
|
||||
// definition correspond to the JSON names of the request fields, and any
|
||||
// fields that are not marked "omitempty" are considered required.
|
||||
func MakePrompt[TReq any](name, description string, handler func(context.Context, *ClientConnection, TReq) (*protocol.GetPromptResult, error), opts ...PromptOption) *Prompt {
|
||||
func NewPrompt[TReq any](name, description string, handler func(context.Context, *ClientConnection, TReq) (*protocol.GetPromptResult, error), opts ...PromptOption) *Prompt {
|
||||
schema, err := jsonschema.For[TReq]()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue