You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: add Grok (xAI) client implementation
- Implement GrokClient with OpenAI-compatible API interface
- Add Grok model enum with latest model variants
- Enable configurable timeouts matching other clients
- Update feature flags to include grok by default
- Add documentation and examples for Grok client usage
* docs: add model list maintenance guidelines
- Add comprehensive documentation for model list updates
- Include official documentation links for OpenAI, Anthropic, and xAI
- Update Grok models with latest model variants (Grok-3, Grok-4)
- Add validation test for Grok client implementation
- Update model enum documentation with reference links
* docs: update model lists with latest versions
- Update OpenAI models with GPT-5 and O1 series
- Update Anthropic models with Claude 4 and 4.5 series
- Add comprehensive model maintenance guidelines
- Update examples and tests to use latest models
* feat: add markdown code block JSON extraction
- Add helper function to extract JSON from markdown code blocks
- Apply extraction before JSON parsing in Anthropic client
- Improve error messages with extracted content
- Maintain fallback to raw content when no code blocks found
Copy file name to clipboardExpand all lines: CLAUDE.md
+52-1Lines changed: 52 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,4 +37,55 @@
37
37
- Never use JSON serialized strings for attribute values (e.g., do not use `examples = r#"["value1"]"#`)
38
38
- Parse container attributes individually without relying on JSON parsing
39
39
- Support multiple attribute specification styles that feel natural in Rust
40
-
- For multi-value attributes, support both parentheses and array syntax
40
+
- For multi-value attributes, support both parentheses and array syntax
41
+
42
+
## Model List Maintenance Guidelines
43
+
44
+
**CRITICAL**: Model lists must be kept up-to-date with provider releases. When adding new providers or updating existing ones, always refer to the official documentation sources below:
45
+
46
+
### Official Model Documentation Sources
47
+
48
+
**OpenAI:**
49
+
- Model Documentation: https://platform.openai.com/docs/models
50
+
- Models API Endpoint: https://platform.openai.com/docs/api-reference/models/list
51
+
52
+
**Anthropic:**
53
+
- All Models Overview: https://docs.anthropic.com/en/docs/about-claude/models/all-models
54
+
- Models List API: https://docs.anthropic.com/en/api/models-list
-**Anthropic**: `GET https://api.anthropic.com/v1/models` (requires `x-api-key: $ANTHROPIC_API_KEY` and `anthropic-version: 2023-06-01`)
65
+
-**xAI (Grok)**: Check `https://docs.x.ai/docs/models` or use their API if available
66
+
2.**NEVER guess model identifiers** - Always get exact model names from API responses or official documentation
67
+
3.**NEVER rely on web search results** - Web search often returns outdated, incorrect, or speculative information
68
+
4.**ALWAYS use exact API identifiers** - Model identifiers must match exactly what the API expects (e.g., `gpt-5-chat-latest`, `claude-sonnet-4-5-20250929`, `grok-4-0709`)
69
+
5.**If API key is not available**: Ask the user to provide the exact model identifiers from the API endpoint, rather than guessing
70
+
6.**Verify date stamps make sense** - If version X.Y is newer than X.Z, its date stamp should be later (e.g., Claude 3.7 date should be after Claude 3.5 date)
71
+
7.**Check for new major versions** - Don't assume only minor version updates; check for major version releases (e.g., Claude 4, GPT-5)
72
+
8.**Verify model name format** - Different providers may use different naming conventions (e.g., `claude-sonnet-4-20250514` vs `claude-4-sonnet-20250514`)
73
+
9.**Filter for chat completion models** - Only include models suitable for chat completions (exclude specialized models like search-api, codex, audio, etc. unless specifically needed)
74
+
75
+
**Steps:**
76
+
1.**Get current models from API**: Use `curl` or API calls to fetch the latest model list from the provider's `/v1/models` endpoint
77
+
2.**Parse API response**: Extract model `id` fields from the JSON response
78
+
3.**Filter appropriate models**: For chat completions, include main chat models and exclude specialized variants unless needed
79
+
4.**Verify model identifiers**: Ensure date stamps and version numbers are correct (e.g., Claude 3.7 should have a date later than Claude 3.5)
80
+
5.**When updating**: Add new models to the appropriate enum (`Model`, `AnthropicModel`, `GrokModel`) in the respective backend files, ordered newest to oldest
81
+
6.**Remove deprecated models**: Check API response for models that are no longer available and remove them
82
+
7.**Default models**: Update default model selection to use the latest recommended model when appropriate
83
+
8.**Documentation**: Update rustdoc comments to reference the official documentation links
84
+
9.**Testing**: Ensure new models work correctly with integration tests
85
+
86
+
### Periodic Review Schedule
87
+
88
+
- Review model lists quarterly or when new models are announced
89
+
- Check for deprecated models and remove or mark them as deprecated
90
+
- Update default model selections to use the latest recommended models
91
+
- Verify all model identifiers match current API documentation
0 commit comments