Class: ClaudeMemory::Ingest::ToolExtractor
- Inherits:
-
Object
- Object
- ClaudeMemory::Ingest::ToolExtractor
- Defined in:
- lib/claude_memory/ingest/tool_extractor.rb
Overview
Extracts tool usage information from JSONL transcript messages Tracks which tools were called during a session
Instance Method Summary collapse
-
#extract(raw_text) ⇒ Array<Hash>
Extract tool calls from raw transcript text.
Instance Method Details
#extract(raw_text) ⇒ Array<Hash>
Extract tool calls from raw transcript text
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/claude_memory/ingest/tool_extractor.rb', line 13 def extract(raw_text) return [] if raw_text.nil? || raw_text.empty? tools = [] raw_text.lines.each do |line| next unless line.strip.start_with?("{") = (line) next unless (, tools) end tools rescue JSON::ParserError # If we encounter any parsing errors, return what we've collected so far tools end |