Skip to content

feat: add Claude Haiku model#99

Merged
karm1000 merged 4 commits into
version-15from
claude-support
Apr 15, 2026
Merged

feat: add Claude Haiku model#99
karm1000 merged 4 commits into
version-15from
claude-support

Conversation

@Abdeali099

@Abdeali099 Abdeali099 commented Apr 15, 2026

Copy link
Copy Markdown
Member

@Abdeali099 Abdeali099 requested a review from karm1000 April 15, 2026 11:40
@Abdeali099

Copy link
Copy Markdown
Member Author

@greptileai

@Abdeali099 Abdeali099 marked this pull request as ready for review April 15, 2026 11:40
@greptile-apps

greptile-apps Bot commented Apr 15, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge; one minor logic edge-case in _fix_malformed_json that only affects a narrow error-recovery path.

All findings are P2 or lower. The core model wiring (model name, base URL, skipping response_format, API key provider) is correct. The only issue is that first_brace is computed but not used in the slice inside _fix_malformed_json, which only matters when Claude returns preamble text before a JSON-like response ending in ']' — an unlikely real-world case that still fails loudly rather than silently.

transaction_parser/transaction_parser/ai_integration/parser.py — _fix_malformed_json slice logic (lines 213–218).

Important Files Changed

Filename Overview
transaction_parser/transaction_parser/ai_integration/models.py Adds ClaudeHaiku dataclass with correct Anthropic OpenAI-compatible base_url, TEXT response format, and supports_response_format=False; registered as "Claude Haiku-4.5" in MODELS dict.
transaction_parser/transaction_parser/ai_integration/parser.py Adds supports_response_format guard and new _parse_content/_fix_malformed_json methods to handle Claude's text responses; first_brace variable computed but unused in slice (see comment).
transaction_parser/transaction_parser/doctype/transaction_parser_settings/transaction_parser_settings.json Adds "Claude Haiku-4.5" option to the default_ai_model Select field options.
transaction_parser/transaction_parser/doctype/transaction_parser_settings/transaction_parser_settings.py Auto-generated type stubs updated to include "Claude Haiku-4.5" in the default_ai_model Literal type; no logic changes.
transaction_parser/transaction_parser/doctype/transaction_parser_api_key_item/transaction_parser_api_key_item.json Adds "Anthropic" to the service_provider Select field options, enabling Anthropic API key configuration.
transaction_parser/transaction_parser/doctype/transaction_parser_api_key_item/transaction_parser_api_key_item.py Auto-generated type stubs updated to include "Anthropic" in the service_provider Literal type; no logic changes.
transaction_parser/parser_benchmark/doctype/parser_benchmark_dataset/parser_benchmark_dataset.json Adds claude_haiku_45 checkbox field and column_break_clde to the AI Models section of the benchmark dataset DocType.
transaction_parser/parser_benchmark/doctype/parser_benchmark_dataset/parser_benchmark_dataset.py Adds claude_haiku_45 → "Claude Haiku-4.5" mapping to AI_MODEL_FIELD_MAP and updates auto-generated type stubs.
transaction_parser/parser_benchmark/doctype/parser_benchmark_log/parser_benchmark_log.json Adds "Claude Haiku-4.5" to the ai_model Select field options in the benchmark log DocType.
transaction_parser/parser_benchmark/doctype/parser_benchmark_log/parser_benchmark_log.py Auto-generated type stubs updated to include "Claude Haiku-4.5" in the ai_model Literal type; no logic changes.
transaction_parser/parser_benchmark/doctype/parser_benchmark_token_cost/parser_benchmark_token_cost.json Adds "Claude Haiku-4.5" to the ai_model Select field options in the token cost DocType.
transaction_parser/parser_benchmark/doctype/parser_benchmark_token_cost/parser_benchmark_token_cost.py Auto-generated type stubs updated to include "Claude Haiku-4.5" in the ai_model Literal type; no logic changes.
transaction_parser/parser_benchmark/report/transaction_parser_accuracy_analysis/transaction_parser_accuracy_analysis.py Adds "Claude Haiku-4.5" at index 6 in _AI_MODEL_ORDER for report sorting; no other logic changes.
transaction_parser/parser_benchmark/report/transaction_parser_accuracy_analysis/transaction_parser_accuracy_analysis.js Adds "Claude Haiku-4.5" to the AI_MODELS filter list.
transaction_parser/parser_benchmark/report/transaction_parser_benchmark_log_detail/transaction_parser_benchmark_log_detail.js Adds "Claude Haiku-4.5" to the AI_MODELS filter list.
transaction_parser/parser_benchmark/report/transaction_parser_version_comparison/transaction_parser_version_comparison.py Adds "Claude Haiku-4.5" at index 6 in _AI_MODEL_ORDER for report sorting; no other logic changes.
transaction_parser/parser_benchmark/report/transaction_parser_version_comparison/transaction_parser_version_comparison.js Adds "Claude Haiku-4.5" to the AI_MODELS filter list.

Comments Outside Diff (1)

  1. transaction_parser/transaction_parser/ai_integration/parser.py, line 213-218 (link)

    P2 first_brace computed but not used in slice

    first_brace is found to locate the start of the JSON object, but content = "[" + content prepends [ to the full string rather than to content[first_brace:]. If Claude returns a response like "Here is the parsed data: {...}]", the fixed string becomes "[Here is the parsed data: {...}]" which is still invalid JSON, so to_dict throws and the caller surfaces "Failed to parse response content" to the user.

Reviews (1): Last reviewed commit: "feat: update Claude Haiku model configur..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This pull request adds Claude Haiku-4.5 as a supported AI model across the system. Changes include registering the new model in the AI integration configuration with Anthropic as the service provider, adding it to all DocType field options and type definitions for benchmark datasets and logs, extending report filter options, and updating model ordering in reports. A new supports_response_format field is added to the Model base class to handle models that don't support response formatting, with conditional request parameter building in the parser. Anthropic is also added as a service provider option in API key configuration.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description that outlines the scope, motivation, and key changes being introduced in this PR.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding Claude Haiku model support across the codebase, encompassing model configuration, benchmark datasets, reports, and API integration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
transaction_parser/parser_benchmark/report/transaction_parser_accuracy_analysis/transaction_parser_accuracy_analysis.py (1)

28-30: Consider centralizing AI model ordering to avoid drift.

The updated order is correct, but this dictionary is duplicated across multiple report modules. Moving _AI_MODEL_ORDER to a shared constant would prevent future mismatches.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3836317d-7766-4f82-9abf-a4902c8cf6b6

📥 Commits

Reviewing files that changed from the base of the PR and between ddfea10 and 14762c8.

📒 Files selected for processing (17)
  • transaction_parser/parser_benchmark/doctype/parser_benchmark_dataset/parser_benchmark_dataset.json
  • transaction_parser/parser_benchmark/doctype/parser_benchmark_dataset/parser_benchmark_dataset.py
  • transaction_parser/parser_benchmark/doctype/parser_benchmark_log/parser_benchmark_log.json
  • transaction_parser/parser_benchmark/doctype/parser_benchmark_log/parser_benchmark_log.py
  • transaction_parser/parser_benchmark/doctype/parser_benchmark_token_cost/parser_benchmark_token_cost.json
  • transaction_parser/parser_benchmark/doctype/parser_benchmark_token_cost/parser_benchmark_token_cost.py
  • transaction_parser/parser_benchmark/report/transaction_parser_accuracy_analysis/transaction_parser_accuracy_analysis.js
  • transaction_parser/parser_benchmark/report/transaction_parser_accuracy_analysis/transaction_parser_accuracy_analysis.py
  • transaction_parser/parser_benchmark/report/transaction_parser_benchmark_log_detail/transaction_parser_benchmark_log_detail.js
  • transaction_parser/parser_benchmark/report/transaction_parser_version_comparison/transaction_parser_version_comparison.js
  • transaction_parser/parser_benchmark/report/transaction_parser_version_comparison/transaction_parser_version_comparison.py
  • transaction_parser/transaction_parser/ai_integration/models.py
  • transaction_parser/transaction_parser/ai_integration/parser.py
  • transaction_parser/transaction_parser/doctype/transaction_parser_api_key_item/transaction_parser_api_key_item.json
  • transaction_parser/transaction_parser/doctype/transaction_parser_api_key_item/transaction_parser_api_key_item.py
  • transaction_parser/transaction_parser/doctype/transaction_parser_settings/transaction_parser_settings.json
  • transaction_parser/transaction_parser/doctype/transaction_parser_settings/transaction_parser_settings.py

@karm1000 karm1000 merged commit e790737 into version-15 Apr 15, 2026
3 of 4 checks passed
@Abdeali099 Abdeali099 deleted the claude-support branch April 16, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Claude AI model support for AI Parsing

2 participants