diff --git a/server/config.py b/server/config.py index b023a4d24..5f07e85c3 100644 --- a/server/config.py +++ b/server/config.py @@ -4,19 +4,18 @@ This is the Continue configuration file. See https://continue.dev/docs/customization to for documentation of the available options. """ -from continuedev.core.models import Models -from continuedev.core.config.serialized_config import ( +from continuedev.core.config import ( + ContinueConfig, CustomCommand, SlashCommand, - ContinueConfig, ) +from continuedev.core.models import Models from continuedev.libs.llm import OpenAIFreeTrial - from continuedev.plugins.context_providers import ( DiffContextProvider, + GitHubIssuesContextProvider, TerminalContextProvider, URLContextProvider, - GitHubIssuesContextProvider, ) from continuedev.plugins.steps import ( ClearHistoryStep, diff --git a/server/continuedev/__init__.py b/server/continuedev/__init__.py index 1941ab2ce..9a26baeea 100644 --- a/server/continuedev/__init__.py +++ b/server/continuedev/__init__.py @@ -1,7 +1,7 @@ import asyncio from typing import Union -from .core.config.config import ContinueConfig +from .core.config import ContinueConfig from .core.main import Step # from .headless import start_headless_session diff --git a/server/continuedev/__main__.py b/server/continuedev/__main__.py index 17c471cc9..158b1d90a 100644 --- a/server/continuedev/__main__.py +++ b/server/continuedev/__main__.py @@ -9,7 +9,7 @@ from rich.markdown import Markdown from tqdm import tqdm from . import run -from .core.config.config import ContinueConfig +from .core.config import ContinueConfig from .headless import get_headless_autopilot from .headless.headless_ide import LocalIdeProtocol from .libs.index.build_index import build_index diff --git a/server/continuedev/core/autopilot.py b/server/continuedev/core/autopilot.py index 1e6657117..e0c76f763 100644 --- a/server/continuedev/core/autopilot.py +++ b/server/continuedev/core/autopilot.py @@ -23,7 +23,7 @@ from ..plugins.policies.default import DefaultPolicy from ..plugins.steps.on_traceback import DefaultOnTracebackStep from ..server.protocols.gui_protocol import AbstractGUIProtocolServer from ..server.protocols.ide_protocol import AbstractIdeProtocolServer -from .config.config import ContinueConfig +from .config import ContinueConfig from .context import ContextManager from .main import ( AutopilotGenerator, diff --git a/server/continuedev/core/config.py b/server/continuedev/core/config.py new file mode 100644 index 000000000..cd13f75bc --- /dev/null +++ b/server/continuedev/core/config.py @@ -0,0 +1,588 @@ +import json +import os +from contextlib import contextmanager +from typing import Any, Dict, List, Optional + +from pydantic import BaseModel, Field, validator + +from ..libs.llm.base import LLM +from ..libs.llm.openai_free_trial import OpenAIFreeTrial +from ..libs.util.paths import ( + convertConfigImports, + getConfigFilePath, + getGlobalFolderPath, +) +from ..libs.util.telemetry import posthog_logger +from ..models.llm import BaseCompletionOptions, RequestOptions +from .config_utils.context import ( + CLASS_TO_CONTEXT_PROVIDER_NAME, + CONTEXT_PROVIDER_NAME_TO_CLASS, + ContextProviderName, +) +from .config_utils.shared import ( + MODEL_CLASS_TO_MODEL_PROVIDER, + MODEL_PROVIDER_TO_MODEL_CLASS, + ModelProvider, + StepName, + TemplateType, + autodetect_prompt_templates, + autodetect_template_function, +) +from .context import ContextProvider +from .main import ContextProviderDescription, Policy, SlashCommandDescription, Step +from .models import MODEL_CLASSES, Models + + +class StepWithParams(BaseModel): + name: StepName + params: Dict[str, Any] = {} + + +class ContextProviderWithParams(BaseModel): + name: ContextProviderName + params: Dict[str, Any] = {} + + +class SlashCommand(BaseModel): + name: str + description: str + step: StepName + params: Optional[Dict] = {} + + # Allow step class for the migration + @validator("step", pre=True, always=True) + def step_is_string(cls, v): + if isinstance(v, str): + return v + elif isinstance(v, object): + return str(v).split(".")[-1].split("'")[0] + else: + raise ValueError("Step must be a string or a Step object") + + def slash_command_description(self) -> SlashCommandDescription: + return SlashCommandDescription( + name=self.name, + description=self.description, + ) + + +class CustomCommand(BaseModel): + name: str + prompt: str + description: str + + def slash_command_description(self) -> SlashCommandDescription: + return SlashCommandDescription( + name=self.name, + description=self.description, + ) + + +class RetrievalSettings(BaseModel): + n_retrieve: Optional[int] = Field( + default=50, + description="Number of results to initially retrieve from vector database", + ) + n_final: Optional[int] = Field( + default=10, description="Final number of results to use after re-ranking" + ) + use_reranking: bool = Field( + default=True, + description="Whether to use re-ranking, which will allow initial selection of n_retrieve results, then will use an LLM to select the top n_final results", + ) + rerank_group_size: int = Field( + default=5, + description="Number of results to group together when re-ranking. Each group will be processed in parallel.", + ) + ignore_files: List[str] = Field( + default=[], + description="Files to ignore when indexing the codebase. You can use glob patterns, such as **/*.py. This is useful for directories that contain generated code, or other directories that are not relevant to the codebase.", + ) + openai_api_key: Optional[str] = Field(default=None, description="OpenAI API key") + api_base: Optional[str] = Field(default=None, description="OpenAI API base URL") + api_type: Optional[str] = Field(default=None, description="OpenAI API type") + api_version: Optional[str] = Field(default=None, description="OpenAI API version") + organization_id: Optional[str] = Field( + default=None, description="OpenAI organization ID" + ) + + +class ModelDescription(BaseModel): + class Config: + extra = "allow" + + title: str = Field( + default=..., + description="The title you wish to give your model.", + ) + + provider: ModelProvider = Field( + default=..., + description="The provider of the model. This is used to determine the type of model, and how to interact with it.", + ) + model: str = Field( + default=..., + description="The name of the model. Used to autodetect prompt template.", + ) + api_key: Optional[str] = Field( + default=None, description="OpenAI, Anthropic, Together, or other API key" + ) + api_base: Optional[str] = Field(None, description="The base URL of the LLM API.") + + context_length: int = Field( + default=2048, + description="The maximum context length of the LLM in tokens, as counted by count_tokens.", + ) + template: Optional[TemplateType] = Field( + default=None, + description="The chat template used to format messages. This is auto-detected for most models, but can be overridden here.", + ) + completion_options: BaseCompletionOptions = Field( + default=BaseCompletionOptions(), + description="Options for the completion endpoint. Read more about the completion options in the documentation.", + ) + system_message: Optional[str] = Field( + default=None, + description="A system message that will always be followed by the LLM", + ) + + request_options: RequestOptions = Field( + default=RequestOptions(), + description="Options for the HTTP request to the LLM.", + ) + + +class ModelRoles(BaseModel): + default: str = Field( + default=..., + description="The default model. If other model roles are not set, they will fall back to default.", + ) + chat: Optional[str] = Field( + default=None, + description="The model to use for chat. If not set, will fall back to default.", + ) + edit: Optional[str] = Field( + default=None, + description="The model to use for editing. If not set, will fall back to default.", + ) + summarize: Optional[str] = Field( + default=None, + description="The model to use for summarization. If not set, will fall back to default.", + ) + + +CONFIG_JSON_PATH = getConfigFilePath(json=True) + + +class SerializedContinueConfig(BaseModel): + disallowed_steps: Optional[List[str]] = Field( + default=[], + description="Steps that are not allowed to be run, and will be skipped if attempted", + ) + allow_anonymous_telemetry: Optional[bool] = Field( + default=True, + description="If this field is set to True, we will collect anonymous telemetry as described in the documentation page on telemetry. If set to False, we will not collect any data.", + ) + models: List[ModelDescription] = Field( + default=[ + { + "title": "GPT-4 (trial)", + "provider": "openai-free-trial", + "model": "gpt-4", + "api_key": "", + } + ] + ) + model_roles: ModelRoles = Field( + default=ModelRoles(default="GPT-4 (trial)"), + description="Roles for models. Each entry should be the title of a model in the models array.", + ) + system_message: Optional[str] = Field( + default=None, + description="A system message that will always be followed by the LLM", + ) + completion_options: BaseCompletionOptions = Field( + default=BaseCompletionOptions(), + description="Default options for completion. These will be overriden by any options set for a specific model.", + ) + slash_commands: Optional[List[SlashCommand]] = Field( + default=[], + description="An array of slash commands that let you map custom Steps to a shortcut.", + ) + custom_commands: Optional[List[CustomCommand]] = Field( + default=[ + CustomCommand( + name="test", + description="This is an example custom command. Use /config to edit it and create more", + prompt="Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", + ) + ], + description="An array of custom commands that allow you to reuse prompts. Each has name, description, and prompt properties. When you enter / in the text input, it will act as a shortcut to the prompt.", + ) + context_providers: List[ContextProviderWithParams] = Field( + default=[], + description="A list of ContextProvider objects that can be used to provide context to the LLM by typing '@'. Read more about ContextProviders in the documentation.", + ) + user_token: Optional[str] = Field( + default=None, description="An optional token to identify the user." + ) + data_server_url: Optional[str] = Field( + default="https://us-west1-autodebug.cloudfunctions.net", + description="The URL of the server where development data is sent. No data is sent unless a valid user token is provided.", + ) + disable_summaries: Optional[bool] = Field( + default=False, + description="If set to `True`, Continue will not generate summaries for each Step. This can be useful if you want to save on compute.", + ) + disable_indexing: Optional[bool] = Field( + default=False, + description="If set to `True`, Continue will not index the codebase. This is mainly used for debugging purposes.", + ) + retrieval_settings: Optional[RetrievalSettings] = Field( + default=RetrievalSettings(), + description="Settings for the retrieval system. Read more about the retrieval system in the documentation.", + ) + + @staticmethod + @contextmanager + def edit_config(): + config = SerializedContinueConfig.parse_file(CONFIG_JSON_PATH) + yield config + with open(CONFIG_JSON_PATH, "w") as f: + f.write(config.json(exclude_none=True, exclude_defaults=True, indent=2)) + + @staticmethod + def set_temperature(temperature: float): + with SerializedContinueConfig.edit_config() as config: + config.completion_options.temperature = temperature + + posthog_logger.capture_event( + "set_temperature", {"temperature": temperature} + ) + + @staticmethod + def set_system_message(message: str): + with SerializedContinueConfig.edit_config() as config: + config.system_message = message + + posthog_logger.capture_event("set_system_message", {"message": message}) + + @staticmethod + def set_model_for_role(title: str, role: str): + with SerializedContinueConfig.edit_config() as config: + if role == "*": + config.model_roles.default = title + config.model_roles.chat = title + config.model_roles.edit = title + config.model_roles.summarize = title + else: + config.model_roles.__setattr__(role, title) + + @staticmethod + def add_model(model: ModelDescription): + with SerializedContinueConfig.edit_config() as config: + config.models.append(model) + + @staticmethod + def set_telemetry_enabled(enabled: bool): + with SerializedContinueConfig.edit_config() as config: + config.allow_anonymous_telemetry = enabled + + @staticmethod + def delete_model(title: str): + with SerializedContinueConfig.edit_config() as config: + config.models = [model for model in config.models if model.title != title] + if config.model_roles.default == title: + config.model_roles.default = config.models[0].title + if config.model_roles.chat == title: + config.model_roles.chat = None + if config.model_roles.edit == title: + config.model_roles.edit = None + if config.model_roles.summarize == title: + config.model_roles.summarize = None + + def construct_models(self) -> Models: + def model_with_title(title: Optional[str], fallback: ModelDescription): + return next(filter(lambda x: x.title == title, self.models), fallback) + + default = model_with_title(self.model_roles.default, self.models[0]) + chat = model_with_title(self.model_roles.chat, default) + edit = model_with_title(self.model_roles.edit, default) + summarize = model_with_title(self.model_roles.summarize, default) + + saved = [ + model_with_title(model.title, default) + for model in self.models + if model.title + not in [default.title, chat.title, edit.title, summarize.title] + ] + + def create_llm(model: ModelDescription) -> LLM: + model_class = MODEL_CLASSES[MODEL_PROVIDER_TO_MODEL_CLASS[model.provider]] + completion_options = self.completion_options.dict() + completion_options.update(model.completion_options.dict(exclude_none=True)) + + # Allow extra fields to be passed through + kwargs = {**model.dict(exclude_none=True)} + kwargs["completion_options"] = completion_options + kwargs["template_messages"] = autodetect_template_function(model.model) + kwargs["prompt_templates"] = autodetect_prompt_templates(model.model) + + return model_class(**kwargs) + + return Models( + default=create_llm(default), + chat=create_llm(chat), + edit=create_llm(edit), + summarize=create_llm(summarize), + saved=[create_llm(model) for model in saved], + ) + + +class ContinueConfig(BaseModel): + """ + Continue can be deeply customized by editing the `ContinueConfig` object in `~/.continue/config.py` (`%userprofile%\.continue\config.py` for Windows) on your machine. This class is instantiated from the config file for every new session. + """ + + steps_on_startup: List[Step] = Field( + default=[], + description="Steps that will be automatically run at the beginning of a new session", + ) + disallowed_steps: Optional[List[str]] = Field( + default=[], + description="Steps that are not allowed to be run, and will be skipped if attempted", + ) + allow_anonymous_telemetry: Optional[bool] = Field( + default=True, + description="If this field is set to True, we will collect anonymous telemetry as described in the documentation page on telemetry. If set to False, we will not collect any data.", + ) + models: Models = Field( + default=Models( + default=OpenAIFreeTrial(model="gpt-4"), + summarize=OpenAIFreeTrial(model="gpt-3.5-turbo"), + ), + description="Configuration for the models used by Continue. Read more about how to configure models in the documentation.", + ) + system_message: Optional[str] = Field( + default=None, + description="A system message that will always be followed by the LLM", + ) + completion_options: BaseCompletionOptions = Field( + default=BaseCompletionOptions(), + description="Options for the completion endpoint. Read more about the completion options in the documentation.", + ) + custom_commands: Optional[List[CustomCommand]] = Field( + default=[ + CustomCommand( + name="test", + description="This is an example custom command. Use /config to edit it and create more", + prompt="Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", + ) + ], + description="An array of custom commands that allow you to reuse prompts. Each has name, description, and prompt properties. When you enter / in the text input, it will act as a shortcut to the prompt.", + ) + slash_commands: Optional[List[SlashCommand]] = Field( + default=[], + description="An array of slash commands that let you map custom Steps to a shortcut.", + ) + on_traceback: Optional[Step] = Field( + default=None, + description="The step that will be run when a traceback is detected (when you use the shortcut cmd+shift+R)", + ) + policy_override: Optional[Policy] = Field( + default=None, + description="A Policy object that can be used to override the default behavior of Continue, for example in order to build custom agents that take multiple steps at a time.", + ) + context_providers: List[ContextProvider] = Field( + default=[], + description="A list of ContextProvider objects that can be used to provide context to the LLM by typing '@'. Read more about ContextProviders in the documentation.", + ) + user_token: Optional[str] = Field( + default=None, description="An optional token to identify the user." + ) + data_server_url: Optional[str] = Field( + default="https://us-west1-autodebug.cloudfunctions.net", + description="The URL of the server where development data is sent. No data is sent unless a valid user token is provided.", + ) + disable_summaries: Optional[bool] = Field( + default=False, + description="If set to `True`, Continue will not generate summaries for each Step. This can be useful if you want to save on compute.", + ) + disable_indexing: Optional[bool] = Field( + default=False, + description="If set to `True`, Continue will not index the codebase. This is mainly used for debugging purposes.", + ) + retrieval_settings: Optional[RetrievalSettings] = Field( + default=RetrievalSettings(), + description="Settings for the retrieval system. Read more about the retrieval system in the documentation.", + ) + + @staticmethod + def from_serialized_config(config: SerializedContinueConfig) -> "ContinueConfig": + context_providers = [ + CONTEXT_PROVIDER_NAME_TO_CLASS[provider.name](**provider.params) + for provider in config.context_providers + ] + return ContinueConfig( + disallowed_steps=config.disallowed_steps, + allow_anonymous_telemetry=config.allow_anonymous_telemetry, + models=config.construct_models(), + system_message=config.system_message, + completion_options=config.completion_options, + custom_commands=config.custom_commands, + slash_commands=config.slash_commands, + context_providers=context_providers, + user_token=config.user_token, + data_server_url=config.data_server_url, + disable_summaries=config.disable_summaries, + disable_indexing=config.disable_indexing, + retrieval_settings=config.retrieval_settings, + ) + + @staticmethod + def from_filepath(filepath: str, retry: bool = True) -> "ContinueConfig": + if filepath.endswith(".json"): + serialized_config = json.load(open(filepath)) + return ContinueConfig.from_serialized_config( + SerializedContinueConfig(**serialized_config) + ) + + # Use importlib to load the config file config.py at the given path + try: + import importlib.util + + spec = importlib.util.spec_from_file_location("config", filepath) + config = importlib.util.module_from_spec(spec) + spec.loader.exec_module(config) + + return config.config + except ModuleNotFoundError as e: + # Check if the module was "continuedev.src" + if retry and e.name == "continuedev.src": + convertConfigImports(shorten=True) + return ContinueConfig.from_filepath(filepath, retry=False) + else: + raise e + + @staticmethod + def load_default() -> "ContinueConfig": + json_path = os.path.join(getGlobalFolderPath(), "config.json") + if not os.path.exists(json_path): + # MIGRATE FROM OLD CONFIG FORMAT TO JSON + py_path = getConfigFilePath() + config = ContinueConfig.from_filepath(py_path) + with open(json_path, "w") as f: + json.dump(config.to_serialized_continue_config().dict(), f) + + return config + + # And then the second time, load from the json file + config = ContinueConfig.from_filepath(json_path) + return config + + def get_slash_command_descriptions(self) -> List[SlashCommandDescription]: + custom_commands = ( + list( + map( + lambda x: x.slash_command_description(), + self.custom_commands, + ) + ) + or [] + ) + slash_commands = ( + list( + map( + lambda x: x.slash_command_description(), + self.slash_commands, + ) + ) + or [] + ) + cmds = custom_commands + slash_commands + cmds.sort(key=lambda x: x.name == "edit", reverse=True) + return cmds + + def get_context_provider_descriptions(self) -> List[ContextProviderDescription]: + """ + Returns a list of ContextProviderDescriptions + """ + return [ + provider.get_description() + for provider in self.context_providers + if provider.title != "code" # Code isn't used with '@' + ] + [ + ContextProviderDescription( + title="file", + display_title="Files", + description="Reference files in the current workspace", + dynamic=False, + requires_query=False, + ) + ] + + def to_serialized_continue_config(self) -> SerializedContinueConfig: + # For migration purposes + pre_models = self.models.saved + [ + self.models.default, + self.models.chat, + self.models.edit, + self.models.summarize, + ] + titles = set() + models: List[LLM] = [] + for model in pre_models: + if model is None or model.title in titles: + # Remove duplicate models + continue # : ) + + titles.add(model.title) + models.append(model) + + BACKUP_TITLE = "LLM" + + serialized_models = [ + ModelDescription( + title=model.title or BACKUP_TITLE, + provider=MODEL_CLASS_TO_MODEL_PROVIDER[model.__class__.__name__], + api_base=model.api_base, + model=model.model, + completion_options=model.completion_options, + api_key=model.api_key, + context_length=model.context_length, + system_message=model.system_message, + ) + for model in models + if model is not None + ] + + model_roles = ModelRoles( + default=self.models.default.title or BACKUP_TITLE, + chat=(self.models.chat or self.models.default).title, + edit=(self.models.edit or self.models.default).title, + summarize=(self.models.summarize or self.models.default).title, + ) + + return SerializedContinueConfig( + disallowed_steps=self.disallowed_steps, + allow_anonymous_telemetry=self.allow_anonymous_telemetry, + models=serialized_models, + model_roles=model_roles, + system_message=self.system_message, + completion_options=self.completion_options, + custom_commands=self.custom_commands, + slash_commands=self.slash_commands, + context_providers=[ + ContextProviderWithParams( + name=CLASS_TO_CONTEXT_PROVIDER_NAME[provider.title], + params=provider.dict(exclude_none=True, exclude_defaults=True), + ) + for provider in self.context_providers + if provider.title in CLASS_TO_CONTEXT_PROVIDER_NAME + ], + user_token=self.user_token, + data_server_url=self.data_server_url, + disable_summaries=self.disable_summaries, + disable_indexing=self.disable_indexing, + retrieval_settings=self.retrieval_settings, + ) diff --git a/server/continuedev/core/config/config.py b/server/continuedev/core/config/config.py deleted file mode 100644 index 229ffcb5b..000000000 --- a/server/continuedev/core/config/config.py +++ /dev/null @@ -1,199 +0,0 @@ -import json -from typing import List, Optional - -from pydantic import BaseModel, Field - -from ...libs.llm.base import BaseCompletionOptions -from ...libs.llm.openai_free_trial import OpenAIFreeTrial -from ...libs.util.edit_config import ( - create_bool_node, - create_obj_node, - display_llm_class, - edit_config_property, -) -from ...libs.util.paths import convertConfigImports, getConfigFilePath -from ...libs.util.telemetry import posthog_logger -from ..context import ContextProvider -from ..main import ContextProviderDescription, Policy, SlashCommandDescription, Step -from ..models import Models -from .context import CONTEXT_PROVIDER_NAME_TO_CLASS -from .serialized_config import ( - CustomCommand, - ModelDescription, - RetrievalSettings, - SerializedContinueConfig, - SlashCommand, -) - - -class ContinueConfig(BaseModel): - """ - Continue can be deeply customized by editing the `ContinueConfig` object in `~/.continue/config.py` (`%userprofile%\.continue\config.py` for Windows) on your machine. This class is instantiated from the config file for every new session. - """ - - steps_on_startup: List[Step] = Field( - default=[], - description="Steps that will be automatically run at the beginning of a new session", - ) - disallowed_steps: Optional[List[str]] = Field( - default=[], - description="Steps that are not allowed to be run, and will be skipped if attempted", - ) - allow_anonymous_telemetry: Optional[bool] = Field( - default=True, - description="If this field is set to True, we will collect anonymous telemetry as described in the documentation page on telemetry. If set to False, we will not collect any data.", - ) - models: Models = Field( - default=Models( - default=OpenAIFreeTrial(model="gpt-4"), - summarize=OpenAIFreeTrial(model="gpt-3.5-turbo"), - ), - description="Configuration for the models used by Continue. Read more about how to configure models in the documentation.", - ) - system_message: Optional[str] = Field( - default=None, - description="A system message that will always be followed by the LLM", - ) - completion_options: BaseCompletionOptions = Field( - default=BaseCompletionOptions(), - description="Options for the completion endpoint. Read more about the completion options in the documentation.", - ) - custom_commands: Optional[List[CustomCommand]] = Field( - default=[ - CustomCommand( - name="test", - description="This is an example custom command. Use /config to edit it and create more", - prompt="Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", - ) - ], - description="An array of custom commands that allow you to reuse prompts. Each has name, description, and prompt properties. When you enter / in the text input, it will act as a shortcut to the prompt.", - ) - slash_commands: Optional[List[SlashCommand]] = Field( - default=[], - description="An array of slash commands that let you map custom Steps to a shortcut.", - ) - on_traceback: Optional[Step] = Field( - default=None, - description="The step that will be run when a traceback is detected (when you use the shortcut cmd+shift+R)", - ) - policy_override: Optional[Policy] = Field( - default=None, - description="A Policy object that can be used to override the default behavior of Continue, for example in order to build custom agents that take multiple steps at a time.", - ) - context_providers: List[ContextProvider] = Field( - default=[], - description="A list of ContextProvider objects that can be used to provide context to the LLM by typing '@'. Read more about ContextProviders in the documentation.", - ) - user_token: Optional[str] = Field( - default=None, description="An optional token to identify the user." - ) - data_server_url: Optional[str] = Field( - default="https://us-west1-autodebug.cloudfunctions.net", - description="The URL of the server where development data is sent. No data is sent unless a valid user token is provided.", - ) - disable_summaries: Optional[bool] = Field( - default=False, - description="If set to `True`, Continue will not generate summaries for each Step. This can be useful if you want to save on compute.", - ) - disable_indexing: Optional[bool] = Field( - default=False, - description="If set to `True`, Continue will not index the codebase. This is mainly used for debugging purposes.", - ) - retrieval_settings: Optional[RetrievalSettings] = Field( - default=RetrievalSettings(), - description="Settings for the retrieval system. Read more about the retrieval system in the documentation.", - ) - - @staticmethod - def from_serialized_config(config: SerializedContinueConfig) -> "ContinueConfig": - context_providers = [ - CONTEXT_PROVIDER_NAME_TO_CLASS[provider.name](**provider.params) - for provider in config.context_providers - ] - return ContinueConfig( - disallowed_steps=config.disallowed_steps, - allow_anonymous_telemetry=config.allow_anonymous_telemetry, - models=Models.from_serialized_config(config), - system_message=config.system_message, - completion_options=config.completion_options, - custom_commands=config.custom_commands, - slash_commands=config.slash_commands, - context_providers=context_providers, - user_token=config.user_token, - data_server_url=config.data_server_url, - disable_summaries=config.disable_summaries, - disable_indexing=config.disable_indexing, - retrieval_settings=config.retrieval_settings, - ) - - @staticmethod - def from_filepath(filepath: str, retry: bool = True) -> "ContinueConfig": - if filepath.endswith(".json"): - serialized_config = json.load(open(filepath)) - return ContinueConfig.from_serialized_config( - SerializedContinueConfig(**serialized_config) - ) - - # Use importlib to load the config file config.py at the given path - try: - import importlib.util - - spec = importlib.util.spec_from_file_location("config", filepath) - config = importlib.util.module_from_spec(spec) - spec.loader.exec_module(config) - - return config.config - except ModuleNotFoundError as e: - # Check if the module was "continuedev.src" - if retry and e.name == "continuedev.src": - convertConfigImports(shorten=True) - return ContinueConfig.from_filepath(filepath, retry=False) - else: - raise e - - @staticmethod - def load_default() -> "ContinueConfig": - path = getConfigFilePath(json=True) - config = ContinueConfig.from_filepath(path) - return config - - def get_slash_command_descriptions(self) -> List[SlashCommandDescription]: - custom_commands = ( - list( - map( - lambda x: x.slash_command_description(), - self.custom_commands, - ) - ) - or [] - ) - slash_commands = ( - list( - map( - lambda x: x.slash_command_description(), - self.slash_commands, - ) - ) - or [] - ) - cmds = custom_commands + slash_commands - cmds.sort(key=lambda x: x.name == "edit", reverse=True) - return cmds - - def get_context_provider_descriptions(self) -> List[ContextProviderDescription]: - """ - Returns a list of ContextProviderDescriptions - """ - return [ - provider.get_description() - for provider in self.context_providers - if provider.title != "code" # Code isn't used with '@' - ] + [ - ContextProviderDescription( - title="file", - display_title="Files", - description="Reference files in the current workspace", - dynamic=False, - requires_query=False, - ) - ] diff --git a/server/continuedev/core/config/serialized_config.py b/server/continuedev/core/config/serialized_config.py deleted file mode 100644 index c17198613..000000000 --- a/server/continuedev/core/config/serialized_config.py +++ /dev/null @@ -1,270 +0,0 @@ -from contextlib import contextmanager -from typing import Any, Dict, List, Optional - -from pydantic import BaseModel, Field - -from ...libs.util.paths import getConfigFilePath -from ...libs.util.telemetry import posthog_logger -from ...models.llm import BaseCompletionOptions, RequestOptions -from ..main import SlashCommandDescription -from .context import ContextProviderName -from .shared import ModelProvider, StepName, TemplateType - - -class StepWithParams(BaseModel): - name: StepName - params: Dict[str, Any] = {} - - -class ContextProviderWithParams(BaseModel): - name: ContextProviderName - params: Dict[str, Any] = {} - - -class SlashCommand(BaseModel): - name: str - description: str - step: StepName - params: Optional[Dict] = {} - - def slash_command_description(self) -> SlashCommandDescription: - return SlashCommandDescription( - name=self.name, - description=self.description, - ) - - -class CustomCommand(BaseModel): - name: str - prompt: str - description: str - - def slash_command_description(self) -> SlashCommandDescription: - return SlashCommandDescription( - name=self.name, - description=self.description, - ) - - -class RetrievalSettings(BaseModel): - n_retrieve: Optional[int] = Field( - default=50, - description="Number of results to initially retrieve from vector database", - ) - n_final: Optional[int] = Field( - default=10, description="Final number of results to use after re-ranking" - ) - use_reranking: bool = Field( - default=True, - description="Whether to use re-ranking, which will allow initial selection of n_retrieve results, then will use an LLM to select the top n_final results", - ) - rerank_group_size: int = Field( - default=5, - description="Number of results to group together when re-ranking. Each group will be processed in parallel.", - ) - ignore_files: List[str] = Field( - default=[], - description="Files to ignore when indexing the codebase. You can use glob patterns, such as **/*.py. This is useful for directories that contain generated code, or other directories that are not relevant to the codebase.", - ) - openai_api_key: Optional[str] = Field(default=None, description="OpenAI API key") - api_base: Optional[str] = Field(default=None, description="OpenAI API base URL") - api_type: Optional[str] = Field(default=None, description="OpenAI API type") - api_version: Optional[str] = Field(default=None, description="OpenAI API version") - organization_id: Optional[str] = Field( - default=None, description="OpenAI organization ID" - ) - - -class ModelDescription(BaseModel): - class Config: - extra = "allow" - - title: str = Field( - default=..., - description="The title you wish to give your model.", - ) - - provider: ModelProvider = Field( - default=..., - description="The provider of the model. This is used to determine the type of model, and how to interact with it.", - ) - model: str = Field( - default=..., - description="The name of the model. Used to autodetect prompt template.", - ) - api_key: Optional[str] = Field( - default=None, description="OpenAI, Anthropic, Together, or other API key" - ) - api_base: Optional[str] = Field(None, description="The base URL of the LLM API.") - - context_length: int = Field( - default=2048, - description="The maximum context length of the LLM in tokens, as counted by count_tokens.", - ) - template: Optional[TemplateType] = Field( - default=None, - description="The chat template used to format messages. This is auto-detected for most models, but can be overridden here.", - ) - completion_options: BaseCompletionOptions = Field( - default=BaseCompletionOptions(), - description="Options for the completion endpoint. Read more about the completion options in the documentation.", - ) - system_message: Optional[str] = Field( - default=None, - description="A system message that will always be followed by the LLM", - ) - - request_options: RequestOptions = Field( - default=RequestOptions(), - description="Options for the HTTP request to the LLM.", - ) - - -class ModelRoles(BaseModel): - default: str = Field( - default=..., - description="The default model. If other model roles are not set, they will fall back to default.", - ) - chat: Optional[str] = Field( - default=None, - description="The model to use for chat. If not set, will fall back to default.", - ) - edit: Optional[str] = Field( - default=None, - description="The model to use for editing. If not set, will fall back to default.", - ) - summarize: Optional[str] = Field( - default=None, - description="The model to use for summarization. If not set, will fall back to default.", - ) - - -CONFIG_JSON_PATH = getConfigFilePath(json=True) - - -class SerializedContinueConfig(BaseModel): - disallowed_steps: Optional[List[str]] = Field( - default=[], - description="Steps that are not allowed to be run, and will be skipped if attempted", - ) - allow_anonymous_telemetry: Optional[bool] = Field( - default=True, - description="If this field is set to True, we will collect anonymous telemetry as described in the documentation page on telemetry. If set to False, we will not collect any data.", - ) - models: List[ModelDescription] = Field( - default=[ - { - "title": "GPT-4 (trial)", - "provider": "openai-free-trial", - "model": "gpt-4", - "api_key": "", - } - ] - ) - model_roles: ModelRoles = Field( - default=ModelRoles(default="GPT-4 (trial)"), - description="Roles for models. Each entry should be the title of a model in the models array.", - ) - system_message: Optional[str] = Field( - default=None, - description="A system message that will always be followed by the LLM", - ) - completion_options: BaseCompletionOptions = Field( - default=BaseCompletionOptions(), - description="Default options for completion. These will be overriden by any options set for a specific model.", - ) - slash_commands: Optional[List[SlashCommand]] = Field( - default=[], - description="An array of slash commands that let you map custom Steps to a shortcut.", - ) - custom_commands: Optional[List[CustomCommand]] = Field( - default=[ - CustomCommand( - name="test", - description="This is an example custom command. Use /config to edit it and create more", - prompt="Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", - ) - ], - description="An array of custom commands that allow you to reuse prompts. Each has name, description, and prompt properties. When you enter / in the text input, it will act as a shortcut to the prompt.", - ) - context_providers: List[ContextProviderWithParams] = Field( - default=[], - description="A list of ContextProvider objects that can be used to provide context to the LLM by typing '@'. Read more about ContextProviders in the documentation.", - ) - user_token: Optional[str] = Field( - default=None, description="An optional token to identify the user." - ) - data_server_url: Optional[str] = Field( - default="https://us-west1-autodebug.cloudfunctions.net", - description="The URL of the server where development data is sent. No data is sent unless a valid user token is provided.", - ) - disable_summaries: Optional[bool] = Field( - default=False, - description="If set to `True`, Continue will not generate summaries for each Step. This can be useful if you want to save on compute.", - ) - disable_indexing: Optional[bool] = Field( - default=False, - description="If set to `True`, Continue will not index the codebase. This is mainly used for debugging purposes.", - ) - retrieval_settings: Optional[RetrievalSettings] = Field( - default=RetrievalSettings(), - description="Settings for the retrieval system. Read more about the retrieval system in the documentation.", - ) - - @staticmethod - @contextmanager - def edit_config(): - config = SerializedContinueConfig.parse_file(CONFIG_JSON_PATH) - yield config - with open(CONFIG_JSON_PATH, "w") as f: - f.write(config.json(exclude_none=True, exclude_defaults=True, indent=2)) - - @staticmethod - def set_temperature(temperature: float): - with SerializedContinueConfig.edit_config() as config: - config.completion_options.temperature = temperature - - posthog_logger.capture_event( - "set_temperature", {"temperature": temperature} - ) - - @staticmethod - def set_system_message(message: str): - with SerializedContinueConfig.edit_config() as config: - config.system_message = message - - posthog_logger.capture_event("set_system_message", {"message": message}) - - @staticmethod - def set_model_for_role(title: str, role: str): - with SerializedContinueConfig.edit_config() as config: - if role == "*": - config.model_roles.default = title - config.model_roles.chat = title - config.model_roles.edit = title - config.model_roles.summarize = title - else: - config.model_roles.__setattr__(role, title) - - @staticmethod - def add_model(model: ModelDescription): - with SerializedContinueConfig.edit_config() as config: - config.models.append(model) - - @staticmethod - def set_telemetry_enabled(enabled: bool): - with SerializedContinueConfig.edit_config() as config: - config.allow_anonymous_telemetry = enabled - - @staticmethod - def delete_model(title: str): - with SerializedContinueConfig.edit_config() as config: - config.models = [model for model in config.models if model.title != title] - if config.model_roles.default == title: - config.model_roles.default = config.models[0].title - if config.model_roles.chat == title: - config.model_roles.chat = None - if config.model_roles.edit == title: - config.model_roles.edit = None - if config.model_roles.summarize == title: - config.model_roles.summarize = None diff --git a/server/continuedev/core/config/context.py b/server/continuedev/core/config_utils/context.py similarity index 70% rename from server/continuedev/core/config/context.py rename to server/continuedev/core/config_utils/context.py index df169ac23..6e926911e 100644 --- a/server/continuedev/core/config/context.py +++ b/server/continuedev/core/config_utils/context.py @@ -1,4 +1,4 @@ -from typing import Literal +from typing import Dict, Literal from ...plugins.context_providers.diff import DiffContextProvider from ...plugins.context_providers.github import GitHubIssuesContextProvider @@ -27,3 +27,13 @@ CONTEXT_PROVIDER_NAME_TO_CLASS = { "search": SearchContextProvider, "url": URLContextProvider, } + +CLASS_TO_CONTEXT_PROVIDER_NAME: Dict[str, ContextProviderName] = { + "DiffContextProvider": "diff", + "GitHubIssuesContextProvider": "github", + "TerminalContextProvider": "terminal", + "OpenTabsContextProvider": "open", + "GoogleContextProvider": "google", + "SearchContextProvider": "search", + "URLContextProvider": "url", +} diff --git a/server/continuedev/core/config/shared.py b/server/continuedev/core/config_utils/shared.py similarity index 89% rename from server/continuedev/core/config/shared.py rename to server/continuedev/core/config_utils/shared.py index a429498f2..a8de2b7c1 100644 --- a/server/continuedev/core/config/shared.py +++ b/server/continuedev/core/config_utils/shared.py @@ -111,7 +111,7 @@ ModelProvider = Literal[ MODEL_PROVIDER_TO_MODEL_CLASS = { "openai": "OpenAI", "openai-free-trial": "OpenAIFreeTrial", - "openai-aiohttp": "OpenAIFreeTrial", + "openai-aiohttp": "GGML", "anthropic": "AnthropicLLM", "together": "TogetherLLM", "ollama": "Ollama", @@ -123,6 +123,20 @@ MODEL_PROVIDER_TO_MODEL_CLASS = { "google-palm": "GooglePaLMAPI", } +MODEL_CLASS_TO_MODEL_PROVIDER: Dict[str, ModelProvider] = { + "OpenAI": "openai", + "OpenAIFreeTrial": "openai-free-trial", + "AnthropicLLM": "anthropic", + "TogetherLLM": "together", + "Ollama": "ollama", + "HuggingFaceTGI": "huggingface-tgi", + "HuggingFaceInferenceAPI": "huggingface-inference-api", + "LlamaCpp": "llama.cpp", + "ReplicateLLM": "replicate", + "TextGenWebUI": "text-gen-webui", + "GooglePaLMAPI": "google-palm", +} + MODELS = [ # OpenAI "gpt-3.5-turbo", diff --git a/server/continuedev/core/models.py b/server/continuedev/core/models.py index dfc2d9d94..5174eb8ba 100644 --- a/server/continuedev/core/models.py +++ b/server/continuedev/core/models.py @@ -1,15 +1,10 @@ import uuid -from typing import Callable, Dict, List, Optional, Type, cast +from typing import Callable, Dict, List, Optional, Type from pydantic import BaseModel, validator -from ..core.config.shared import ( - MODEL_PROVIDER_TO_MODEL_CLASS, - autodetect_prompt_templates, - autodetect_template_function, -) from ..libs.llm.anthropic import AnthropicLLM -from ..libs.llm.base import LLM, BaseCompletionOptions +from ..libs.llm.base import LLM from ..libs.llm.ggml import GGML from ..libs.llm.google_palm_api import GooglePaLMAPI from ..libs.llm.hf_inference_api import HuggingFaceInferenceAPI @@ -21,7 +16,6 @@ from ..libs.llm.openai_free_trial import OpenAIFreeTrial from ..libs.llm.replicate import ReplicateLLM from ..libs.llm.text_gen_webui import TextGenWebUI from ..libs.llm.together import TogetherLLM -from .config.serialized_config import ModelDescription, SerializedContinueConfig class ContinueSDK(BaseModel): @@ -94,44 +88,6 @@ class Models(BaseModel): return values["default"] return v - @staticmethod - def from_serialized_config(config: SerializedContinueConfig) -> "Models": - def model_with_title(title: Optional[str], fallback: ModelDescription): - return next(filter(lambda x: x.title == title, config.models), fallback) - - default = model_with_title(config.model_roles.default, config.models[0]) - chat = model_with_title(config.model_roles.chat, default) - edit = model_with_title(config.model_roles.edit, default) - summarize = model_with_title(config.model_roles.summarize, default) - - saved = [ - model_with_title(model.title, default) - for model in config.models - if model.title - not in [default.title, chat.title, edit.title, summarize.title] - ] - - def create_llm(model: ModelDescription) -> LLM: - model_class = MODEL_CLASSES[MODEL_PROVIDER_TO_MODEL_CLASS[model.provider]] - completion_options = config.completion_options.dict() - completion_options.update(model.completion_options.dict(exclude_none=True)) - - # Allow extra fields to be passed through - kwargs = {**model.dict(exclude_none=True)} - kwargs["completion_options"] = completion_options - kwargs["template_messages"] = autodetect_template_function(model.model) - kwargs["prompt_templates"] = autodetect_prompt_templates(model.model) - - return model_class(**kwargs) - - return Models( - default=create_llm(default), - chat=create_llm(chat), - edit=create_llm(edit), - summarize=create_llm(summarize), - saved=[create_llm(model) for model in saved], - ) - def dict(self, **kwargs): original_dict = super().dict(**kwargs) return original_dict diff --git a/server/continuedev/core/sdk.py b/server/continuedev/core/sdk.py index 62b14ca01..0672e3f3a 100644 --- a/server/continuedev/core/sdk.py +++ b/server/continuedev/core/sdk.py @@ -15,7 +15,7 @@ from ..models.main import Range from ..plugins.context_providers.highlighted_code import HighlightedCodeContextProvider from ..server.protocols.gui_protocol import AbstractGUIProtocolServer from ..server.protocols.ide_protocol import AbstractIdeProtocolServer -from .config.config import ContinueConfig +from .config import ContinueConfig from .lsp import ContinueLSPClient from .main import ( ChatMessage, diff --git a/server/continuedev/headless/__init__.py b/server/continuedev/headless/__init__.py index 5479a81f9..d4f345a94 100644 --- a/server/continuedev/headless/__init__.py +++ b/server/continuedev/headless/__init__.py @@ -1,7 +1,7 @@ from typing import List, Optional, Union from ..core.autopilot import Autopilot -from ..core.config.config import ContinueConfig +from ..core.config import ContinueConfig from ..core.context import ContextManager, ContextProvider from ..core.main import SessionState from ..server.protocols.cli_gui import CommandLineGUI diff --git a/server/continuedev/libs/index/build_index.py b/server/continuedev/libs/index/build_index.py index c4b25444e..cf40b309a 100644 --- a/server/continuedev/libs/index/build_index.py +++ b/server/continuedev/libs/index/build_index.py @@ -1,10 +1,8 @@ import asyncio from typing import AsyncGenerator -from ...core.config.config import ContinueConfig -from ...libs.index.chunkers.chunk_directory import ( - stream_chunk_directory, -) +from ...core.config import ContinueConfig +from ...libs.index.chunkers.chunk_directory import stream_chunk_directory from ...libs.index.indices.chroma_index import MAX_CHUNK_SIZE, ChromaCodebaseIndex from ...libs.index.indices.meilisearch_index import MeilisearchCodebaseIndex from ...server.protocols.ide_protocol import AbstractIdeProtocolServer diff --git a/server/continuedev/libs/util/paths.py b/server/continuedev/libs/util/paths.py index e470d650e..03cb99635 100644 --- a/server/continuedev/libs/util/paths.py +++ b/server/continuedev/libs/util/paths.py @@ -145,6 +145,7 @@ def migrateConfigFile(existing: str) -> Optional[str]: .replace("text_gen_interface", "text_gen_webui") .replace(".steps.chroma", ".steps.codebase") .replace("\xa0", " ") + .replace("server_url", "api_base") ) if migrated != existing: return migrated @@ -158,19 +159,21 @@ def getConfigFilePath(json: bool = False) -> str: ) os.makedirs(os.path.dirname(path), exist_ok=True) - if not os.path.exists(path): - with open(path, "w") as f: - f.write(default_config) - else: - # Make any necessary migrations - with open(path, "r") as f: - existing_content = f.read() - - migrated = migrateConfigFile(existing_content) - - if migrated is not None: + # Until migration considered complete, don't do this for .json + if not json: + if not os.path.exists(path): with open(path, "w") as f: - f.write(migrated) + f.write(default_config) + else: + # Make any necessary migrations + with open(path, "r") as f: + existing_content = f.read() + + migrated = migrateConfigFile(existing_content) + + if migrated is not None: + with open(path, "w") as f: + f.write(migrated) return path diff --git a/server/continuedev/models/generate_json_schema.py b/server/continuedev/models/generate_json_schema.py index e4e735c25..96b17732d 100644 --- a/server/continuedev/models/generate_json_schema.py +++ b/server/continuedev/models/generate_json_schema.py @@ -2,9 +2,8 @@ import os from pydantic import schema_json_of -from ..core.config.config import ContinueConfig -from ..core.config.serialized_config import ModelDescription, SerializedContinueConfig -from ..core.config.shared import ModelName, ModelProvider +from ..core.config import ContinueConfig, ModelDescription, SerializedContinueConfig +from ..core.config_utils.shared import ModelName, ModelProvider from ..core.context import ContextItem, ContextItemId from ..core.main import ( ContextProviderDescription, diff --git a/server/continuedev/plugins/policies/commit.py b/server/continuedev/plugins/policies/commit.py index cd5676c58..2e649aec7 100644 --- a/server/continuedev/plugins/policies/commit.py +++ b/server/continuedev/plugins/policies/commit.py @@ -12,7 +12,7 @@ from textwrap import dedent from typing import Literal -from ...core.config.config import ContinueConfig +from ...core.config import ContinueConfig from ...core.main import Policy, SessionState, Step from ...core.observation import TextObservation from ...core.sdk import ContinueSDK diff --git a/server/continuedev/plugins/policies/default.py b/server/continuedev/plugins/policies/default.py index 52c1c6969..4bbdbe9b0 100644 --- a/server/continuedev/plugins/policies/default.py +++ b/server/continuedev/plugins/policies/default.py @@ -1,6 +1,6 @@ from typing import Type, Union -from ...core.config.config import ContinueConfig +from ...core.config import ContinueConfig from ...core.main import Policy, SessionState, Step from ...models.main import Position, PositionInFile from ..steps.chat import SimpleChatStep diff --git a/server/continuedev/plugins/policies/headless.py b/server/continuedev/plugins/policies/headless.py index f33884c63..19f36a88a 100644 --- a/server/continuedev/plugins/policies/headless.py +++ b/server/continuedev/plugins/policies/headless.py @@ -1,4 +1,4 @@ -from ...core.config.config import ContinueConfig +from ...core.config import ContinueConfig from ...core.main import Policy, SessionState, Step from ...core.observation import TextObservation from ...core.steps import ShellCommandsStep diff --git a/server/continuedev/server/main.py b/server/continuedev/server/main.py index 950c9d459..fabd14aa4 100644 --- a/server/continuedev/server/main.py +++ b/server/continuedev/server/main.py @@ -9,7 +9,7 @@ from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel -from ..core.config.config import ContinueConfig +from ..core.config import ContinueConfig from ..core.main import ContextProviderDescription, SlashCommandDescription from ..libs.util.create_async_task import create_async_task from ..libs.util.devdata import dev_data_logger diff --git a/server/continuedev/server/protocols/gui.py b/server/continuedev/server/protocols/gui.py index 5a2d61e2c..fbd1342f7 100644 --- a/server/continuedev/server/protocols/gui.py +++ b/server/continuedev/server/protocols/gui.py @@ -5,8 +5,7 @@ import socketio from pydantic import BaseModel from ...core.autopilot import Autopilot -from ...core.config.config import ContinueConfig -from ...core.config.serialized_config import ModelDescription, SerializedContinueConfig +from ...core.config import ContinueConfig, ModelDescription, SerializedContinueConfig from ...core.main import ContextItem, SessionState, SessionUpdate, Step, StepDescription from ...libs.util.telemetry import posthog_logger from ...libs.util.types import AsyncFunc diff --git a/server/continuedev/server/window_manager.py b/server/continuedev/server/window_manager.py index 57998d84e..54106e4a5 100644 --- a/server/continuedev/server/window_manager.py +++ b/server/continuedev/server/window_manager.py @@ -2,7 +2,7 @@ import traceback from typing import Dict, Optional from ..core.autopilot import Autopilot -from ..core.config.config import ContinueConfig +from ..core.config import ContinueConfig from ..core.context import ContextManager from ..core.main import SessionState from ..libs.index.build_index import build_index diff --git a/server/tests/step_test.py b/server/tests/step_test.py index a4697ce1f..a9132dd3b 100644 --- a/server/tests/step_test.py +++ b/server/tests/step_test.py @@ -1,5 +1,5 @@ import pytest -from continuedev.core.config.config import ContinueConfig +from continuedev.core.config import ContinueConfig from continuedev.core.steps import UserInputStep from continuedev.headless import start_headless_session from continuedev.models.filesystem import Range, RangeInFileWithContents diff --git a/server/tests/util/config.py b/server/tests/util/config.py index e32d6b987..370933a00 100644 --- a/server/tests/util/config.py +++ b/server/tests/util/config.py @@ -1,4 +1,4 @@ -from continuedev.core.config.config import ContinueConfig +from continuedev.core.config import ContinueConfig from continuedev.core.models import Models from continuedev.libs.llm.openai_free_trial import OpenAIFreeTrial