Mercurial
comparison mrjunejune/inference/sdk_runtime_test.py @ 260:1f9877b637e9
Add Copilot-powered cyberpunk JRPG chat
Integrate the production JRPG chat with Seobeo streaming, Deita persistence, and a Bazel-managed Copilot SDK and LiteLLM inference stack.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <mrjunejune@users.noreply.github.com> |
|---|---|
| date | Wed, 05 Aug 2026 09:19:41 -0700 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 259:667156fcd3e3 | 260:1f9877b637e9 |
|---|---|
| 1 import asyncio | |
| 2 import os | |
| 3 import sys | |
| 4 import unittest | |
| 5 | |
| 6 from copilot import CopilotClient, RuntimeConnection | |
| 7 | |
| 8 CLI_PATH = os.path.abspath(sys.argv.pop(1)) | |
| 9 | |
| 10 | |
| 11 class SdkRuntimeTest(unittest.IsolatedAsyncioTestCase): | |
| 12 async def test_bazel_pinned_cli_starts_without_runtime_download(self) -> None: | |
| 13 self.assertTrue(os.path.isfile(CLI_PATH)) | |
| 14 self.assertTrue(os.access(CLI_PATH, os.X_OK)) | |
| 15 | |
| 16 base_directory = os.path.join( | |
| 17 os.environ["TEST_TMPDIR"], | |
| 18 "copilot-home", | |
| 19 ) | |
| 20 os.makedirs(base_directory) | |
| 21 client = CopilotClient( | |
| 22 connection=RuntimeConnection.for_stdio(path=CLI_PATH), | |
| 23 base_directory=base_directory, | |
| 24 use_logged_in_user=False, | |
| 25 log_level="error", | |
| 26 mode="empty", | |
| 27 ) | |
| 28 try: | |
| 29 await asyncio.wait_for(client.start(), timeout=15) | |
| 30 finally: | |
| 31 await client.stop() | |
| 32 | |
| 33 | |
| 34 if __name__ == "__main__": | |
| 35 unittest.main() |