Class: DSPy::LM::Strategies::AnthropicExtractionStrategy
- Inherits:
-
BaseStrategy
- Object
- BaseStrategy
- DSPy::LM::Strategies::AnthropicExtractionStrategy
show all
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/lm/strategies/anthropic_extraction_strategy.rb
Overview
Strategy for using Anthropic’s enhanced JSON extraction patterns
Instance Method Summary
collapse
#handle_error, #initialize
Instance Method Details
#available? ⇒ Boolean
13
14
15
|
# File 'lib/dspy/lm/strategies/anthropic_extraction_strategy.rb', line 13
def available?
adapter.is_a?(DSPy::LM::AnthropicAdapter)
end
|
34
35
36
37
38
39
40
41
42
|
# File 'lib/dspy/lm/strategies/anthropic_extraction_strategy.rb', line 34
def (response)
if adapter.respond_to?(:extract_json_from_response)
adapter.(response.content)
else
(response.content)
end
end
|
#name ⇒ Object
23
24
25
|
# File 'lib/dspy/lm/strategies/anthropic_extraction_strategy.rb', line 23
def name
"anthropic_extraction"
end
|
#prepare_request(messages, request_params) ⇒ Object
28
29
30
31
|
# File 'lib/dspy/lm/strategies/anthropic_extraction_strategy.rb', line 28
def prepare_request(messages, request_params)
end
|
#priority ⇒ Object
18
19
20
|
# File 'lib/dspy/lm/strategies/anthropic_extraction_strategy.rb', line 18
def priority
90
end
|