File tree Expand file tree Collapse file tree 4 files changed +59
-8
lines changed
Expand file tree Collapse file tree 4 files changed +59
-8
lines changed Original file line number Diff line number Diff line change 1+ name : Claude Code
2+
3+ on :
4+ issue_comment :
5+ types : [created]
6+ pull_request_review_comment :
7+ types : [created]
8+ issues :
9+ types : [opened, assigned]
10+ pull_request_review :
11+ types : [submitted]
12+
13+ jobs :
14+ claude :
15+ if : |
16+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+ runs-on : ubuntu-latest
21+ permissions :
22+ contents : read
23+ pull-requests : read
24+ issues : read
25+ id-token : write
26+ actions : read # Required for Claude to read CI results on PRs
27+ steps :
28+ - name : Checkout repository
29+ uses : actions/checkout@v4
30+ with :
31+ fetch-depth : 1
32+
33+ - name : Run Claude Code
34+ id : claude
35+ uses : anthropics/claude-code-action@v1
36+ with :
37+ anthropic_api_key : ${{ secrets.ANTHROPIC_API_KEY }}
38+
39+ # This is an optional setting that allows Claude to read CI results on PRs
40+ additional_permissions : |
41+ actions: read
42+
43+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44+ # prompt: 'Update the pull request description to include a summary of changes.'
45+
46+ # Optional: Add claude_args to customize behavior and configuration
47+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48+ # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
49+ # claude_args: '--allowed-tools Bash(gh pr:*)'
50+
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ async def process_query(self, query: str) -> str:
6464
6565 # Initial Claude API call
6666 response = self .anthropic .messages .create (
67- model = "claude-3-5- sonnet-20241022 " ,
67+ model = "claude-sonnet-4-0 " ,
6868 max_tokens = 1000 ,
6969 messages = messages ,
7070 tools = available_tools
@@ -97,7 +97,7 @@ async def process_query(self, query: str) -> str:
9797
9898 # Get next response from Claude
9999 response = self .anthropic .messages .create (
100- model = "claude-3-5- sonnet-20241022 " ,
100+ model = "claude-sonnet-4-0 " ,
101101 max_tokens = 1000 ,
102102 messages = messages ,
103103 )
Original file line number Diff line number Diff line change @@ -92,15 +92,14 @@ class MCPClient {
9292
9393 // Initial Claude API call
9494 const response = await this . anthropic . messages . create ( {
95- model : "claude-3-5- sonnet-20241022 " ,
95+ model : "claude-sonnet-4-0 " ,
9696 max_tokens : 1000 ,
9797 messages,
9898 tools : this . tools ,
9999 } ) ;
100100
101101 // Process response and handle tool calls
102102 const finalText = [ ] ;
103- const toolResults = [ ] ;
104103
105104 for ( const content of response . content ) {
106105 if ( content . type === "text" ) {
@@ -114,7 +113,6 @@ class MCPClient {
114113 name : toolName ,
115114 arguments : toolArgs ,
116115 } ) ;
117- toolResults . push ( result ) ;
118116 finalText . push (
119117 `[Calling tool ${ toolName } with args ${ JSON . stringify ( toolArgs ) } ]` ,
120118 ) ;
@@ -127,7 +125,7 @@ class MCPClient {
127125
128126 // Get next response from Claude
129127 const response = await this . anthropic . messages . create ( {
130- model : "claude-3-5- sonnet-20241022 " ,
128+ model : "claude-sonnet-4-0 " ,
131129 max_tokens : 1000 ,
132130 messages,
133131 } ) ;
Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ async def get_forecast(latitude: float, longitude: float) -> str:
8989
9090 return "\n ---\n " .join (forecasts )
9191
92- if __name__ == "__main__" :
92+ def main () :
9393 # Initialize and run the server
94- mcp .run (transport = 'stdio' )
94+ mcp .run (transport = 'stdio' )
95+
96+ if __name__ == "__main__" :
97+ main ()
You can’t perform that action at this time.
0 commit comments