Class: MockServer::MCP::McpPromptBuilder
- Inherits:
-
Object
- Object
- MockServer::MCP::McpPromptBuilder
- Defined in:
- lib/mockserver/mcp.rb
Instance Method Summary collapse
- #and_then ⇒ McpMockBuilder (also: #and_)
-
#initialize(parent, name) ⇒ McpPromptBuilder
constructor
A new instance of McpPromptBuilder.
- #responding_with(role, text_content) ⇒ self
- #with_argument(name, description, required) ⇒ self
- #with_description(description) ⇒ self
Constructor Details
#initialize(parent, name) ⇒ McpPromptBuilder
Returns a new instance of McpPromptBuilder.
416 417 418 419 |
# File 'lib/mockserver/mcp.rb', line 416 def initialize(parent, name) @parent = parent @prompt = PromptDef.new(name, nil, [], []) end |
Instance Method Details
#and_then ⇒ McpMockBuilder Also known as: and_
440 441 442 443 |
# File 'lib/mockserver/mcp.rb', line 440 def and_then @parent.add_prompt(@prompt) @parent end |
#responding_with(role, text_content) ⇒ self
434 435 436 437 |
# File 'lib/mockserver/mcp.rb', line 434 def responding_with(role, text_content) @prompt. << PromptMessage.new(role, text_content) self end |
#with_argument(name, description, required) ⇒ self
428 429 430 431 |
# File 'lib/mockserver/mcp.rb', line 428 def with_argument(name, description, required) @prompt.arguments << PromptArg.new(name, description, required) self end |
#with_description(description) ⇒ self
422 423 424 425 |
# File 'lib/mockserver/mcp.rb', line 422 def with_description(description) @prompt.description = description self end |