continue-custom/server/continuedev/__init__.py
Nate Sesti 279593a848
Strong typing (#533)
* refactor: ♻️ get rid of continuedev.src.continuedev structure

* refactor: ♻️ switching back to server folder

* feat: ✨ make config.py imports shorter

* feat: 🔖 publish as pre-release vscode extension

* refactor: ♻️ refactor and add more completion params to ui

* build: 🏗️ download from preview S3
2023-10-04 23:47:59 -07:00

19 lines
580 B
Python

import asyncio
from typing import Union
from .core.config import ContinueConfig
from .core.main import Step
from .headless import start_headless_session
def run(step_or_config: Union[Step, ContinueConfig]):
if isinstance(step_or_config, ContinueConfig):
config = step_or_config
else:
config = ContinueConfig()
config.steps_on_startup = [step_or_config]
loop = asyncio.get_event_loop()
loop.run_until_complete(start_headless_session(config=config))
tasks = asyncio.all_tasks(loop)
loop.run_until_complete(asyncio.gather(*tasks))