MCPcopy Create free account
hub / github.com/HKUDS/AutoAgent / check_auth

Method check_auth

autoagent/tools/github_client.py:27–36  ·  view source on GitHub ↗

Check if the token is valid

(self)

Source from the content-addressed store, hash-verified

25 self.api_base = 'https://api.github.com'
26
27 def check_auth(self) -> dict:
28 """
29 Check if the token is valid
30 """
31 try:
32 response = self.session.get(f'{self.api_base}/user')
33 response.raise_for_status()
34 return {'status': 0, 'message': 'Authentication successful', 'user': response.json()}
35 except Exception as e:
36 return {'status': -1, 'message': f'Authentication failed: {str(e)}'}
37
38 def create_pull_request(self, repo: str, title: str, body: str, head: str, base: str) -> dict:
39 """

Callers 1

submit_pull_requestFunction · 0.95

Calls 1

getMethod · 0.80

Tested by

no test coverage detected