hedit 0.7.11.dev1__tar.gz → 0.7.11.dev5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. {hedit-0.7.11.dev1/hedit.egg-info → hedit-0.7.11.dev5}/PKG-INFO +4 -7
  2. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/PKG_README.md +2 -3
  3. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/README.md +6 -4
  4. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5/hedit.egg-info}/PKG-INFO +4 -7
  5. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/hedit.egg-info/SOURCES.txt +6 -5
  6. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/hedit.egg-info/requires.txt +1 -3
  7. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/pyproject.toml +3 -5
  8. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/api/main.py +427 -526
  9. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/api/models.py +90 -23
  10. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/api/security.py +24 -17
  11. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/api_executor.py +2 -10
  12. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/client.py +25 -23
  13. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/config.py +47 -56
  14. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/local_executor.py +103 -105
  15. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/main.py +35 -71
  16. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/output.py +83 -11
  17. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/scripts/process_feedback.py +9 -11
  18. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/telemetry/schema.py +60 -12
  19. hedit-0.7.11.dev5/src/utils/anthropic_llm.py +346 -0
  20. hedit-0.7.11.dev5/src/utils/llm_usage.py +345 -0
  21. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/version.py +1 -1
  22. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_annotation_agent.py +55 -0
  23. hedit-0.7.11.dev5/tests/test_anthropic_llm.py +307 -0
  24. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_api_endpoints.py +275 -78
  25. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_cli_client.py +21 -13
  26. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_cli_config.py +23 -23
  27. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_cli_integration.py +12 -11
  28. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_cli_main.py +66 -6
  29. hedit-0.7.11.dev5/tests/test_cli_usage_report.py +209 -0
  30. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_feedback_integration.py +14 -28
  31. hedit-0.7.11.dev1/tests/test_integration_openrouter.py → hedit-0.7.11.dev5/tests/test_integration_anthropic.py +140 -64
  32. hedit-0.7.11.dev5/tests/test_llm_usage.py +294 -0
  33. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_security.py +31 -8
  34. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_telemetry.py +99 -0
  35. hedit-0.7.11.dev1/src/utils/litellm_llm.py +0 -195
  36. hedit-0.7.11.dev1/src/utils/openrouter_llm.py +0 -233
  37. hedit-0.7.11.dev1/tests/test_litellm_llm.py +0 -266
  38. hedit-0.7.11.dev1/tests/test_openrouter_llm.py +0 -261
  39. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/LICENSE +0 -0
  40. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/hedit.egg-info/dependency_links.txt +0 -0
  41. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/hedit.egg-info/entry_points.txt +0 -0
  42. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/hedit.egg-info/top_level.txt +0 -0
  43. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/setup.cfg +0 -0
  44. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/__init__.py +0 -0
  45. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/__init__.py +0 -0
  46. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/annotation_agent.py +0 -0
  47. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/assessment_agent.py +0 -0
  48. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/evaluation_agent.py +0 -0
  49. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/feedback_summarizer.py +0 -0
  50. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/feedback_triage_agent.py +0 -0
  51. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/state.py +0 -0
  52. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/validation_agent.py +0 -0
  53. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/vision_agent.py +0 -0
  54. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/agents/workflow.py +0 -0
  55. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/api/__init__.py +0 -0
  56. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/__init__.py +0 -0
  57. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/commands/__init__.py +0 -0
  58. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/commands/lsp.py +0 -0
  59. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/cli/executor.py +0 -0
  60. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/data/__init__.py +0 -0
  61. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/data/hed-docs/02_Terminology.md +0 -0
  62. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/data/hed-docs/HedAnnotationSemantics.md +0 -0
  63. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/data/hed-docs/manifest.json +0 -0
  64. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/lsp/__init__.py +0 -0
  65. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/lsp/client.py +0 -0
  66. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/lsp/daemon.py +0 -0
  67. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/lsp/protocol.py +0 -0
  68. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/scripts/__init__.py +0 -0
  69. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/telemetry/__init__.py +0 -0
  70. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/telemetry/collector.py +0 -0
  71. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/telemetry/storage.py +0 -0
  72. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/utils/__init__.py +0 -0
  73. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/utils/error_remediation.py +0 -0
  74. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/utils/github_client.py +0 -0
  75. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/utils/hed_comprehensive_guide.py +0 -0
  76. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/utils/hed_docs_loader.py +0 -0
  77. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/utils/image_processing.py +0 -0
  78. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/utils/json_schema_loader.py +0 -0
  79. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/utils/schema_loader.py +0 -0
  80. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/validation/__init__.py +0 -0
  81. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/validation/hed_lsp.py +0 -0
  82. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/src/validation/hed_validator.py +0 -0
  83. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_comprehensive_guide.py +0 -0
  84. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_error_remediation.py +0 -0
  85. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_feedback_triage.py +0 -0
  86. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_fetch_hed_docs.py +0 -0
  87. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_github_client.py +0 -0
  88. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_hed_docs_loader.py +0 -0
  89. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_json_schema_loader.py +0 -0
  90. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_no_extend_propagation.py +0 -0
  91. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_schema_loader.py +0 -0
  92. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_state.py +0 -0
  93. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_validation.py +0 -0
  94. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_validation_agent.py +0 -0
  95. {hedit-0.7.11.dev1 → hedit-0.7.11.dev5}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hedit
3
- Version: 0.7.11.dev1
3
+ Version: 0.7.11.dev5
4
4
  Summary: Multi-agent system for HED annotation generation and validation
5
5
  Author-email: Annotation Garden Initiative <info@annotation.garden>
6
6
  License-Expression: MIT
@@ -30,9 +30,7 @@ Requires-Dist: langgraph>=0.2.0; extra == "standalone"
30
30
  Requires-Dist: langchain>=0.3.0; extra == "standalone"
31
31
  Requires-Dist: langchain-community>=0.3.0; extra == "standalone"
32
32
  Requires-Dist: langchain-core>=0.3.0; extra == "standalone"
33
- Requires-Dist: langchain-openai>=0.3.0; extra == "standalone"
34
- Requires-Dist: litellm>=1.50.0; extra == "standalone"
35
- Requires-Dist: langchain-litellm>=0.2.0; extra == "standalone"
33
+ Requires-Dist: langchain-anthropic>=1.0.0; extra == "standalone"
36
34
  Requires-Dist: hedtools>=0.5.0; extra == "standalone"
37
35
  Requires-Dist: lxml>=5.3.0; extra == "standalone"
38
36
  Requires-Dist: beautifulsoup4>=4.12.3; extra == "standalone"
@@ -79,8 +77,8 @@ pip install hedit[standalone]
79
77
  ## Quick Start
80
78
 
81
79
  ```bash
82
- # Configure your OpenRouter API key (https://openrouter.ai)
83
- hedit init --api-key sk-or-v1-xxx
80
+ # Initialize the CLI (API mode needs no key; add an Anthropic key for BYOK)
81
+ hedit init
84
82
 
85
83
  # Generate HED annotation from text
86
84
  hedit annotate "participant pressed the left button"
@@ -127,7 +125,6 @@ Annotations are automatically refined until validation passes.
127
125
  - [Documentation](https://docs.annotation.garden/hedit)
128
126
  - [GitHub Repository](https://github.com/Annotation-Garden/HEDit)
129
127
  - [HED Standard](https://hedtags.org)
130
- - [OpenRouter](https://openrouter.ai) - Get an API key
131
128
 
132
129
  ## License
133
130
 
@@ -20,8 +20,8 @@ pip install hedit[standalone]
20
20
  ## Quick Start
21
21
 
22
22
  ```bash
23
- # Configure your OpenRouter API key (https://openrouter.ai)
24
- hedit init --api-key sk-or-v1-xxx
23
+ # Initialize the CLI (API mode needs no key; add an Anthropic key for BYOK)
24
+ hedit init
25
25
 
26
26
  # Generate HED annotation from text
27
27
  hedit annotate "participant pressed the left button"
@@ -68,7 +68,6 @@ Annotations are automatically refined until validation passes.
68
68
  - [Documentation](https://docs.annotation.garden/hedit)
69
69
  - [GitHub Repository](https://github.com/Annotation-Garden/HEDit)
70
70
  - [HED Standard](https://hedtags.org)
71
- - [OpenRouter](https://openrouter.ai) - Get an API key
72
71
 
73
72
  ## License
74
73
 
@@ -15,8 +15,8 @@ pip install hedit
15
15
  ## Quick Start
16
16
 
17
17
  ```bash
18
- # Initialize with your OpenRouter API key (get one at https://openrouter.ai)
19
- hedit init --api-key sk-or-v1-xxx
18
+ # Initialize the CLI (API mode needs no key; add an Anthropic key for BYOK)
19
+ hedit init
20
20
 
21
21
  # Generate HED annotation from natural language
22
22
  hedit annotate "participant pressed the left button with their index finger"
@@ -66,7 +66,8 @@ Config files are stored in `~/.config/hedit/`:
66
66
  - **Natural Language to HED**: Describe events in plain English, get valid HED annotations
67
67
  - **Image Annotation**: Annotate visual stimuli directly from image files
68
68
  - **Multi-Stage Validation**: AI agents generate, validate, evaluate, and refine annotations
69
- - **Bring Your Own Key**: Uses OpenRouter API; you control your LLM costs and model choice
69
+ - **Claude-Powered**: Anthropic Claude models (Haiku 4.5 default, Sonnet 5 optional); bring your own Anthropic key if you prefer your own billing
70
+ - **Cost Transparency**: Every annotation reports its token use and how much prompt caching saved (typically ~80% of input cost after the first request)
70
71
  - **JSON Output**: Easy integration with scripts and pipelines
71
72
  - **HED Schema Support**: Works with official HED schemas (8.x)
72
73
 
@@ -83,8 +84,8 @@ The agents work in feedback loops, automatically refining the annotation until i
83
84
 
84
85
  ## Documentation
85
86
 
87
+ - [Prompt Caching and Usage Reporting](docs/prompt-caching.md) - What HEDit caches, what it saves, and where to see the numbers
86
88
  - [HED Standard](https://hedtags.org) - Learn about HED annotations
87
- - [OpenRouter](https://openrouter.ai) - Get an API key for LLM access
88
89
  - [GitHub Issues](https://github.com/Annotation-Garden/HEDit/issues) - Report bugs or request features
89
90
 
90
91
  ## Server Deployment
@@ -235,6 +236,7 @@ uvicorn src.api.main:app --reload --host 0.0.0.0 --port 38427
235
236
  - `POST /annotate`: Generate HED annotation from natural language
236
237
  - `POST /validate`: Validate HED annotation
237
238
  - `GET /health`: Health check
239
+ - `GET /metrics`: Token use, cost, and prompt-cache savings since startup (server API key required)
238
240
  - API URL: `http://localhost:38427`
239
241
 
240
242
  ## Development
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hedit
3
- Version: 0.7.11.dev1
3
+ Version: 0.7.11.dev5
4
4
  Summary: Multi-agent system for HED annotation generation and validation
5
5
  Author-email: Annotation Garden Initiative <info@annotation.garden>
6
6
  License-Expression: MIT
@@ -30,9 +30,7 @@ Requires-Dist: langgraph>=0.2.0; extra == "standalone"
30
30
  Requires-Dist: langchain>=0.3.0; extra == "standalone"
31
31
  Requires-Dist: langchain-community>=0.3.0; extra == "standalone"
32
32
  Requires-Dist: langchain-core>=0.3.0; extra == "standalone"
33
- Requires-Dist: langchain-openai>=0.3.0; extra == "standalone"
34
- Requires-Dist: litellm>=1.50.0; extra == "standalone"
35
- Requires-Dist: langchain-litellm>=0.2.0; extra == "standalone"
33
+ Requires-Dist: langchain-anthropic>=1.0.0; extra == "standalone"
36
34
  Requires-Dist: hedtools>=0.5.0; extra == "standalone"
37
35
  Requires-Dist: lxml>=5.3.0; extra == "standalone"
38
36
  Requires-Dist: beautifulsoup4>=4.12.3; extra == "standalone"
@@ -79,8 +77,8 @@ pip install hedit[standalone]
79
77
  ## Quick Start
80
78
 
81
79
  ```bash
82
- # Configure your OpenRouter API key (https://openrouter.ai)
83
- hedit init --api-key sk-or-v1-xxx
80
+ # Initialize the CLI (API mode needs no key; add an Anthropic key for BYOK)
81
+ hedit init
84
82
 
85
83
  # Generate HED annotation from text
86
84
  hedit annotate "participant pressed the left button"
@@ -127,7 +125,6 @@ Annotations are automatically refined until validation passes.
127
125
  - [Documentation](https://docs.annotation.garden/hedit)
128
126
  - [GitHub Repository](https://github.com/Annotation-Garden/HEDit)
129
127
  - [HED Standard](https://hedtags.org)
130
- - [OpenRouter](https://openrouter.ai) - Get an API key
131
128
 
132
129
  ## License
133
130
 
@@ -49,24 +49,26 @@ src/telemetry/collector.py
49
49
  src/telemetry/schema.py
50
50
  src/telemetry/storage.py
51
51
  src/utils/__init__.py
52
+ src/utils/anthropic_llm.py
52
53
  src/utils/error_remediation.py
53
54
  src/utils/github_client.py
54
55
  src/utils/hed_comprehensive_guide.py
55
56
  src/utils/hed_docs_loader.py
56
57
  src/utils/image_processing.py
57
58
  src/utils/json_schema_loader.py
58
- src/utils/litellm_llm.py
59
- src/utils/openrouter_llm.py
59
+ src/utils/llm_usage.py
60
60
  src/utils/schema_loader.py
61
61
  src/validation/__init__.py
62
62
  src/validation/hed_lsp.py
63
63
  src/validation/hed_validator.py
64
64
  tests/test_annotation_agent.py
65
+ tests/test_anthropic_llm.py
65
66
  tests/test_api_endpoints.py
66
67
  tests/test_cli_client.py
67
68
  tests/test_cli_config.py
68
69
  tests/test_cli_integration.py
69
70
  tests/test_cli_main.py
71
+ tests/test_cli_usage_report.py
70
72
  tests/test_comprehensive_guide.py
71
73
  tests/test_error_remediation.py
72
74
  tests/test_feedback_integration.py
@@ -74,11 +76,10 @@ tests/test_feedback_triage.py
74
76
  tests/test_fetch_hed_docs.py
75
77
  tests/test_github_client.py
76
78
  tests/test_hed_docs_loader.py
77
- tests/test_integration_openrouter.py
79
+ tests/test_integration_anthropic.py
78
80
  tests/test_json_schema_loader.py
79
- tests/test_litellm_llm.py
81
+ tests/test_llm_usage.py
80
82
  tests/test_no_extend_propagation.py
81
- tests/test_openrouter_llm.py
82
83
  tests/test_schema_loader.py
83
84
  tests/test_security.py
84
85
  tests/test_state.py
@@ -30,9 +30,7 @@ langgraph>=0.2.0
30
30
  langchain>=0.3.0
31
31
  langchain-community>=0.3.0
32
32
  langchain-core>=0.3.0
33
- langchain-openai>=0.3.0
34
- litellm>=1.50.0
35
- langchain-litellm>=0.2.0
33
+ langchain-anthropic>=1.0.0
36
34
  hedtools>=0.5.0
37
35
  lxml>=5.3.0
38
36
  beautifulsoup4>=4.12.3
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hedit"
7
- version = "0.7.11.dev1"
7
+ version = "0.7.11.dev5"
8
8
  description = "Multi-agent system for HED annotation generation and validation"
9
9
  readme = "PKG_README.md"
10
10
  requires-python = ">=3.12"
@@ -56,9 +56,7 @@ standalone = [
56
56
  "langchain>=0.3.0",
57
57
  "langchain-community>=0.3.0",
58
58
  "langchain-core>=0.3.0",
59
- "langchain-openai>=0.3.0",
60
- "litellm>=1.50.0", # LLM proxy with native prompt caching support
61
- "langchain-litellm>=0.2.0", # LangChain integration for LiteLLM
59
+ "langchain-anthropic>=1.0.0", # Claude via official Anthropic SDK (native prompt caching)
62
60
  "hedtools>=0.5.0",
63
61
  "lxml>=5.3.0",
64
62
  "beautifulsoup4>=4.12.3",
@@ -126,7 +124,7 @@ addopts = [
126
124
  # Unit tests alone get ~18%, integration tests combined get 70%+
127
125
  markers = [
128
126
  "integration: marks tests that make real API calls (deselect with '-m \"not integration\"')",
129
- "standalone: marks tests that run locally without backend (requires OPENROUTER_API_KEY_FOR_TESTING)",
127
+ "standalone: marks tests that run locally without backend (requires ANTHROPIC_API_KEY)",
130
128
  "timeout: marks tests with a timeout (requires pytest-timeout)",
131
129
  ]
132
130
  asyncio_mode = "auto"