diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-09-12 00:59:20 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-09-12 00:59:20 -0700 |
commit | 331b2adcb6f8d962e4ed19292fd2ab5838ba479e (patch) | |
tree | 055989d31f18f18971d9f8e3e5764b59ed0c2be5 /continuedev/src/continuedev/core | |
parent | e9afb41bed9a723876cf1cf95d636b2ea498a6b3 (diff) | |
download | sncontinue-331b2adcb6f8d962e4ed19292fd2ab5838ba479e.tar.gz sncontinue-331b2adcb6f8d962e4ed19292fd2ab5838ba479e.tar.bz2 sncontinue-331b2adcb6f8d962e4ed19292fd2ab5838ba479e.zip |
docs: :memo: major docs improvements
Diffstat (limited to 'continuedev/src/continuedev/core')
-rw-r--r-- | continuedev/src/continuedev/core/config.py | 83 | ||||
-rw-r--r-- | continuedev/src/continuedev/core/context.py | 46 |
2 files changed, 94 insertions, 35 deletions
diff --git a/continuedev/src/continuedev/core/config.py b/continuedev/src/continuedev/core/config.py index b513e22a..e8b2c579 100644 --- a/continuedev/src/continuedev/core/config.py +++ b/continuedev/src/continuedev/core/config.py @@ -1,6 +1,6 @@ from typing import Dict, List, Optional, Type -from pydantic import BaseModel, validator +from pydantic import BaseModel, Field, validator from ..libs.llm.maybe_proxy_openai import MaybeProxyOpenAI from .context import ContextProvider @@ -31,31 +31,68 @@ class CustomCommand(BaseModel): class ContinueConfig(BaseModel): """ - A pydantic class for the continue config file. + 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] = [] - disallowed_steps: Optional[List[str]] = [] - allow_anonymous_telemetry: Optional[bool] = True - models: Models = Models( - default=MaybeProxyOpenAI(model="gpt-4"), - medium=MaybeProxyOpenAI(model="gpt-3.5-turbo"), + steps_on_startup: List[Step] = Field( + [], + description="Steps that will be automatically run at the beginning of a new session", + ) + disallowed_steps: Optional[List[str]] = Field( + [], + description="Steps that are not allowed to be run, and will be skipped if attempted", + ) + allow_anonymous_telemetry: Optional[bool] = Field( + 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( + Models( + default=MaybeProxyOpenAI(model="gpt-4"), + medium=MaybeProxyOpenAI(model="gpt-3.5-turbo"), + ), + description="Configuration for the models used by Continue. Read more about how to configure models in the documentation.", + ) + temperature: Optional[float] = Field( + 0.5, + description="The temperature parameter for sampling from the LLM. Higher temperatures will result in more random output, while lower temperatures will result in more predictable output. This value ranges from 0 to 1.", + ) + custom_commands: Optional[List[CustomCommand]] = Field( + [ + 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 /<name> in the text input, it will act as a shortcut to the prompt.", + ) + slash_commands: Optional[List[SlashCommand]] = Field( + [], + description="An array of slash commands that let you map custom Steps to a shortcut.", + ) + on_traceback: Optional[Step] = Field( + None, + description="The step that will be run when a traceback is detected (when you use the shortcut cmd+shift+R)", + ) + system_message: Optional[str] = Field( + None, description="A system message that will always be followed by the LLM" + ) + policy_override: Optional[Policy] = Field( + 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( + [], + 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( + None, description="An optional token to identify the user." + ) + data_server_url: Optional[str] = Field( + "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.", ) - temperature: Optional[float] = 0.5 - custom_commands: Optional[List[CustomCommand]] = [ - 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.", - ) - ] - slash_commands: Optional[List[SlashCommand]] = [] - on_traceback: Optional[Step] = None - system_message: Optional[str] = None - policy_override: Optional[Policy] = None - context_providers: List[ContextProvider] = [] - user_token: Optional[str] = None - data_server_url: Optional[str] = "https://us-west1-autodebug.cloudfunctions.net" @validator("temperature", pre=True) def temperature_validator(cls, v): diff --git a/continuedev/src/continuedev/core/context.py b/continuedev/src/continuedev/core/context.py index c9768a97..f2658602 100644 --- a/continuedev/src/continuedev/core/context.py +++ b/continuedev/src/continuedev/core/context.py @@ -4,7 +4,7 @@ from abc import abstractmethod from typing import Awaitable, Callable, Dict, List from meilisearch_python_async import Client -from pydantic import BaseModel +from pydantic import BaseModel, Field from ..libs.util.create_async_task import create_async_task from ..libs.util.devdata import dev_data_logger @@ -37,17 +37,39 @@ class ContextProvider(BaseModel): When you hit enter on an option, the context provider will add that item to the autopilot's list of context (which is all stored in the ContextManager object). """ - title: str - sdk: ContinueSDK = None - delete_documents: Callable[[List[str]], Awaitable] = None - update_documents: Callable[[List[ContextItem], str], Awaitable] = None - - display_title: str - description: str - dynamic: bool - requires_query: bool = False - - selected_items: List[ContextItem] = [] + title: str = Field( + ..., + description="The title of the ContextProvider. This is what must be typed in the input to trigger the ContextProvider.", + ) + sdk: ContinueSDK = Field( + None, description="The ContinueSDK instance accessible by the ContextProvider" + ) + delete_documents: Callable[[List[str]], Awaitable] = Field( + None, description="Function to delete documents" + ) + update_documents: Callable[[List[ContextItem], str], Awaitable] = Field( + None, description="Function to update documents" + ) + + display_title: str = Field( + ..., + description="The display title of the ContextProvider shown in the dropdown menu", + ) + description: str = Field( + ..., + description="A description of the ContextProvider displayed in the dropdown menu", + ) + dynamic: bool = Field( + ..., description="Indicates whether the ContextProvider is dynamic" + ) + requires_query: bool = Field( + False, + description="Indicates whether the ContextProvider requires a query. For example, the SearchContextProvider requires you to type '@search <STRING_TO_SEARCH>'. This will change the behavior of the UI so that it can indicate the expectation for a query.", + ) + + selected_items: List[ContextItem] = Field( + [], description="List of selected items in the ContextProvider" + ) def dict(self, *args, **kwargs): original_dict = super().dict(*args, **kwargs) |