Class: Utcp::Providers::BaseProvider
- Inherits:
-
Object
- Object
- Utcp::Providers::BaseProvider
- Defined in:
- lib/utcp/providers/base_provider.rb
Direct Known Subclasses
CliProvider, GraphQLProvider, HttpProvider, HttpStreamProvider, McpProvider, SseProvider, TcpProvider, UdpProvider, WebSocketProvider
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#call_tool(tool, arguments = {}, &block) ⇒ Object
Execute a tool, possibly streaming chunks via &block.
-
#discover_tools! ⇒ Object
Returns [Array<Tool>].
-
#initialize(name:, provider_type:, auth: nil) ⇒ BaseProvider
constructor
A new instance of BaseProvider.
Constructor Details
#initialize(name:, provider_type:, auth: nil) ⇒ BaseProvider
7 8 9 10 11 |
# File 'lib/utcp/providers/base_provider.rb', line 7 def initialize(name:, provider_type:, auth: nil) @name = name @type = provider_type @auth = auth end |
Instance Attribute Details
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
5 6 7 |
# File 'lib/utcp/providers/base_provider.rb', line 5 def auth @auth end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/utcp/providers/base_provider.rb', line 5 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/utcp/providers/base_provider.rb', line 5 def type @type end |
Instance Method Details
#call_tool(tool, arguments = {}, &block) ⇒ Object
Execute a tool, possibly streaming chunks via &block
19 20 21 |
# File 'lib/utcp/providers/base_provider.rb', line 19 def call_tool(tool, arguments = {}, &block) raise NotImplementedError end |
#discover_tools! ⇒ Object
Returns [Array<Tool>]
14 15 16 |
# File 'lib/utcp/providers/base_provider.rb', line 14 def discover_tools! raise NotImplementedError end |