>>> async def main():
... client = CopilotClient()
... await client.start()
... await client.start()
... session = await client.create_session(on_permission_request=PermissionHandler.approve_all, model="auto")
... response = await session.send_and_wait("What is 2 + 2?")
... print(response.data.content)
... await client.stop()
...
>>> asyncio.run(main())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\erxinsha\projects\frameworks.ai.benchmarkqa.ci\venv\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\erxinsha\projects\frameworks.ai.benchmarkqa.ci\venv\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "<stdin>", line 5, in main
File "C:\Users\erxinsha\projects\frameworks.ai.benchmarkqa.ci\venv\lib\typing.py", line 983, in __getattr__
return getattr(self.__origin__, attr)
AttributeError: type object 'Callable' has no attribute 'approve_all'
>>>
Description
Test the SDK code with https://github.com/github/copilot-sdk/blob/main/docs/setup/bundled-cli.md python QuickStart.
Code
Environment
Python 3.10.19
OS Windows
copilot 0.1.9
github-copilot-sdk 0.1.25