diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-09-11 18:33:17 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-09-11 18:33:17 -0700 |
commit | e9afb41bed9a723876cf1cf95d636b2ea498a6b3 (patch) | |
tree | 35387d7f3df1d28d742b3289c7ff930caa457d8e | |
parent | 0c9482681f28720dcf75b2ab9d1bbf4d148912d7 (diff) | |
download | sncontinue-e9afb41bed9a723876cf1cf95d636b2ea498a6b3.tar.gz sncontinue-e9afb41bed9a723876cf1cf95d636b2ea498a6b3.tar.bz2 sncontinue-e9afb41bed9a723876cf1cf95d636b2ea498a6b3.zip |
docs: :memo: working on autogenerated docs
23 files changed, 254 insertions, 26 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json index e264c367..674c23a4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -26,6 +26,13 @@ "subProcess": true }, { + "name": "Reference", + "type": "python", + "request": "launch", + "module": "continuedev.src.continuedev.models.reference.test", + "justMyCode": true + }, + { "name": "Server", "type": "python", "request": "launch", diff --git a/continuedev/src/continuedev/core/context.py b/continuedev/src/continuedev/core/context.py index 25f6be14..c9768a97 100644 --- a/continuedev/src/continuedev/core/context.py +++ b/continuedev/src/continuedev/core/context.py @@ -192,6 +192,7 @@ class ContextManager: requires_query=provider.requires_query, ) for provider in self.context_providers.values() + if provider.title != "code" ] async def get_selected_items(self) -> List[ContextItem]: diff --git a/continuedev/src/continuedev/libs/llm/openai.py b/continuedev/src/continuedev/libs/llm/openai.py index 857dc52d..70594973 100644 --- a/continuedev/src/continuedev/libs/llm/openai.py +++ b/continuedev/src/continuedev/libs/llm/openai.py @@ -2,6 +2,7 @@ from typing import Callable, List, Literal, Optional import certifi import openai +from pydantic import Field from ...core.main import ChatMessage from ..llm import LLM @@ -26,7 +27,15 @@ MAX_TOKENS_FOR_MODEL = { class OpenAI(LLM): - api_key: str + """ + The OpenAI class can be used to access OpenAI models like gpt-4 and gpt-3.5-turbo. + + If you are running a local model with an OpenAI-compatible API, you can also use the OpenAI class by changing the `api_base` argument. + """ + + api_key: str = Field( + description="OpenAI API key", + ) "OpenAI API key" verify_ssl: Optional[bool] = None diff --git a/continuedev/src/continuedev/models/reference/test.py b/continuedev/src/continuedev/models/reference/test.py new file mode 100644 index 00000000..2d1db3e1 --- /dev/null +++ b/continuedev/src/continuedev/models/reference/test.py @@ -0,0 +1,64 @@ +import importlib +import json +from textwrap import dedent # noqa: F401 + +LLM_MODULES = [ + ("openai", "OpenAI"), + ("anthropic", "AnthropicLLM"), + ("ggml", "GGML"), + ("llamacpp", "LlamaCpp"), + ("text_gen_interface", "TextGenUI"), + ("ollama", "Ollama"), + ("queued", "QueuedLLM"), + ("replicate", "ReplicateLLM"), + ("together", "TogetherLLM"), +] + + +def import_llm_module(module_name, module_title): + module_name = f"continuedev.src.continuedev.libs.llm.{module_name}" + module = importlib.import_module(module_name) + obj = getattr(module, module_title) + return obj + + +def llm_docs_from_schema(schema, filename): + # Generate markdown docs + markdown_docs = dedent( + f"""\ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# {schema['title']} + +{dedent(schema.get("description", ""))} + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/{filename}.py) + +## Properties + +""" + ) + + for prop, details in schema["properties"].items(): + required = prop in schema.get("required", []) + if not required: + continue + required = "true" if required else "false" + markdown_docs += f"<ClassPropertyRef name='{prop}' details='{json.dumps(details)}' required={{{required}}}/>" + + for prop, details in schema["properties"].items(): + required = prop in schema.get("required", []) + if required: + continue + required = "true" if required else "false" + markdown_docs += f"<ClassPropertyRef name='{prop}' details='{json.dumps(details)}' required={{{required}}}/>" + + return markdown_docs + + +for module_name, module_title in LLM_MODULES: + obj = import_llm_module(module_name, module_title) + schema = obj.schema() + markdown_docs = llm_docs_from_schema(schema, module_name) + with open(f"docs/docs/reference/Models/{module_name}.md", "w") as f: + f.write(markdown_docs) diff --git a/continuedev/src/continuedev/plugins/policies/default.py b/continuedev/src/continuedev/plugins/policies/default.py index 550defa9..26b6bd48 100644 --- a/continuedev/src/continuedev/plugins/policies/default.py +++ b/continuedev/src/continuedev/plugins/policies/default.py @@ -18,7 +18,7 @@ def parse_slash_command(inp: str, config: ContinueConfig) -> Union[None, Step]: Parses a slash command, returning the command name and the rest of the input. """ if inp.startswith("/"): - command_name = inp.split(" ")[0] + command_name = inp.split(" ")[0].strip() after_command = " ".join(inp.split(" ")[1:]) for slash_command in config.slash_commands: @@ -35,7 +35,7 @@ def parse_slash_command(inp: str, config: ContinueConfig) -> Union[None, Step]: def parse_custom_command(inp: str, config: ContinueConfig) -> Union[None, Step]: - command_name = inp.split(" ")[0] + command_name = inp.split(" ")[0].strip() after_command = " ".join(inp.split(" ")[1:]) for custom_cmd in config.custom_commands: if custom_cmd.name == command_name[1:]: diff --git a/docs/docs/context-providers.md b/docs/docs/customization/context-providers.md index 3147f90e..3147f90e 100644 --- a/docs/docs/context-providers.md +++ b/docs/docs/customization/context-providers.md diff --git a/docs/docs/customization/intro.md b/docs/docs/customization/intro.md new file mode 100644 index 00000000..a82b5dbf --- /dev/null +++ b/docs/docs/customization/intro.md @@ -0,0 +1,10 @@ +# Customizing Continue + +Continue can be deeply customized by editing the `ContinueConfig` object in `~/.continue/config.py` (`%userprofile%\.continue\config.py` for Windows) on your machine. This file is created the first time you run Continue. + +Currently, you can customize the following: + +- [Models](./models.md) - Use Continue with any LLM, including local models, Azure OpenAI service, and any OpenAI-compatible API. +- [Context Providers](./context-providers.md) - Define which sources you want to collect context from to share with the LLM. Just type '@' to easily add attachments to your prompt. +- [Slash Commands](./slash-commands.md) - Call custom prompts or programs written with our SDK by typing `/` in the prompt. +- [Other Configuration](./other-configuration.md) - Configure other settings like the system message, temperature, and more. diff --git a/docs/docs/customization/models.md b/docs/docs/customization/models.md new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/docs/docs/customization/models.md diff --git a/docs/docs/customization/other-configuration.md b/docs/docs/customization/other-configuration.md new file mode 100644 index 00000000..088b2aac --- /dev/null +++ b/docs/docs/customization/other-configuration.md @@ -0,0 +1 @@ +# Other Configuration diff --git a/docs/docs/customization/slash-commands.md b/docs/docs/customization/slash-commands.md new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/docs/docs/customization/slash-commands.md diff --git a/docs/docs/reference/Context Providers/intro.md b/docs/docs/reference/Context Providers/intro.md new file mode 100644 index 00000000..1e0981f1 --- /dev/null +++ b/docs/docs/reference/Context Providers/intro.md @@ -0,0 +1 @@ +# Intro diff --git a/docs/docs/reference/Models/anthropic.md b/docs/docs/reference/Models/anthropic.md new file mode 100644 index 00000000..1aa31324 --- /dev/null +++ b/docs/docs/reference/Models/anthropic.md @@ -0,0 +1,11 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# AnthropicLLM + + + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/anthropic.py) + +## Properties + +<ClassPropertyRef name='api_key' details='{"title": "Api Key", "type": "string"}' required={true}/><ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='model' details='{"title": "Model", "default": "claude-2", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {}, "type": "object"}' required={false}/>
\ No newline at end of file diff --git a/docs/docs/reference/Models/ggml.md b/docs/docs/reference/Models/ggml.md new file mode 100644 index 00000000..dafc8870 --- /dev/null +++ b/docs/docs/reference/Models/ggml.md @@ -0,0 +1,11 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# GGML + + + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/ggml.py) + +## Properties + +<ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='model' details='{"title": "Model", "default": "ggml", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {"edit": "[INST] Consider the following code:\n```\n{{code_to_edit}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{user_input}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.\n[/INST]"}, "type": "object"}' required={false}/><ClassPropertyRef name='api_key' details='{"title": "Api Key", "type": "string"}' required={false}/><ClassPropertyRef name='server_url' details='{"title": "Server Url", "default": "http://localhost:8000", "type": "string"}' required={false}/><ClassPropertyRef name='verify_ssl' details='{"title": "Verify Ssl", "type": "boolean"}' required={false}/><ClassPropertyRef name='ca_bundle_path' details='{"title": "Ca Bundle Path", "type": "string"}' required={false}/>
\ No newline at end of file diff --git a/docs/docs/reference/Models/llamacpp.md b/docs/docs/reference/Models/llamacpp.md new file mode 100644 index 00000000..7ce75574 --- /dev/null +++ b/docs/docs/reference/Models/llamacpp.md @@ -0,0 +1,11 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# LlamaCpp + + + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/llamacpp.py) + +## Properties + +<ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='model' details='{"title": "Model", "default": "llamacpp", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {"edit": "[INST] Consider the following code:\n```\n{{code_to_edit}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{user_input}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.\n[/INST]"}, "type": "object"}' required={false}/><ClassPropertyRef name='api_key' details='{"title": "Api Key", "type": "string"}' required={false}/><ClassPropertyRef name='server_url' details='{"title": "Server Url", "default": "http://localhost:8080", "type": "string"}' required={false}/><ClassPropertyRef name='verify_ssl' details='{"title": "Verify Ssl", "type": "boolean"}' required={false}/><ClassPropertyRef name='llama_cpp_args' details='{"title": "Llama Cpp Args", "default": {"stop": ["[INST]"]}, "type": "object"}' required={false}/><ClassPropertyRef name='use_command' details='{"title": "Use Command", "type": "string"}' required={false}/>
\ No newline at end of file diff --git a/docs/docs/reference/Models/ollama.md b/docs/docs/reference/Models/ollama.md new file mode 100644 index 00000000..ef058119 --- /dev/null +++ b/docs/docs/reference/Models/ollama.md @@ -0,0 +1,11 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# Ollama + + + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/ollama.py) + +## Properties + +<ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='model' details='{"title": "Model", "default": "llama2", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {"edit": "[INST] Consider the following code:\n```\n{{code_to_edit}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{user_input}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.\n[/INST]"}, "type": "object"}' required={false}/><ClassPropertyRef name='api_key' details='{"title": "Api Key", "type": "string"}' required={false}/><ClassPropertyRef name='server_url' details='{"title": "Server Url", "default": "http://localhost:11434", "type": "string"}' required={false}/>
\ No newline at end of file diff --git a/docs/docs/reference/Models/openai.md b/docs/docs/reference/Models/openai.md new file mode 100644 index 00000000..d325ca2f --- /dev/null +++ b/docs/docs/reference/Models/openai.md @@ -0,0 +1,13 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# OpenAI + +The OpenAI class can be used to access OpenAI models like gpt-4 and gpt-3.5-turbo. + +If you are running a local model with an OpenAI-compatible API, you can also use the OpenAI class by changing the `api_base` argument. + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/openai.py) + +## Properties + +<ClassPropertyRef name='model' details='{"title": "Model", "type": "string"}' required={true}/><ClassPropertyRef name='api_key' details='{"title": "Api Key", "description": "OpenAI API key", "type": "string"}' required={true}/><ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {}, "type": "object"}' required={false}/><ClassPropertyRef name='verify_ssl' details='{"title": "Verify Ssl", "type": "boolean"}' required={false}/><ClassPropertyRef name='ca_bundle_path' details='{"title": "Ca Bundle Path", "type": "string"}' required={false}/><ClassPropertyRef name='proxy' details='{"title": "Proxy", "type": "string"}' required={false}/><ClassPropertyRef name='api_base' details='{"title": "Api Base", "type": "string"}' required={false}/><ClassPropertyRef name='api_type' details='{"title": "Api Type", "enum": ["azure", "openai"], "type": "string"}' required={false}/><ClassPropertyRef name='api_version' details='{"title": "Api Version", "type": "string"}' required={false}/><ClassPropertyRef name='engine' details='{"title": "Engine", "type": "string"}' required={false}/>
\ No newline at end of file diff --git a/docs/docs/reference/Models/queued.md b/docs/docs/reference/Models/queued.md new file mode 100644 index 00000000..6888a4e5 --- /dev/null +++ b/docs/docs/reference/Models/queued.md @@ -0,0 +1,11 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# QueuedLLM + + + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/queued.py) + +## Properties + +<ClassPropertyRef name='llm' details='{"$ref": "#/definitions/LLM"}' required={true}/><ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='model' details='{"title": "Model", "default": "queued", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {}, "type": "object"}' required={false}/><ClassPropertyRef name='api_key' details='{"title": "Api Key", "type": "string"}' required={false}/>
\ No newline at end of file diff --git a/docs/docs/reference/Models/replicate.md b/docs/docs/reference/Models/replicate.md new file mode 100644 index 00000000..4f05cdfa --- /dev/null +++ b/docs/docs/reference/Models/replicate.md @@ -0,0 +1,11 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# ReplicateLLM + + + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/replicate.py) + +## Properties + +<ClassPropertyRef name='api_key' details='{"title": "Api Key", "type": "string"}' required={true}/><ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='model' details='{"title": "Model", "default": "replicate/llama-2-70b-chat:58d078176e02c219e11eb4da5a02a7830a283b14cf8f94537af893ccff5ee781", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {"edit": "[INST] Consider the following code:\n```\n{{code_to_edit}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{user_input}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.\n[/INST]"}, "type": "object"}' required={false}/>
\ No newline at end of file diff --git a/docs/docs/reference/Models/text_gen_interface.md b/docs/docs/reference/Models/text_gen_interface.md new file mode 100644 index 00000000..a59a4166 --- /dev/null +++ b/docs/docs/reference/Models/text_gen_interface.md @@ -0,0 +1,11 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# TextGenUI + + + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/text_gen_interface.py) + +## Properties + +<ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='model' details='{"title": "Model", "default": "text-gen-ui", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {"edit": "[INST] Consider the following code:\n```\n{{code_to_edit}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{user_input}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.\n[/INST]"}, "type": "object"}' required={false}/><ClassPropertyRef name='api_key' details='{"title": "Api Key", "type": "string"}' required={false}/><ClassPropertyRef name='server_url' details='{"title": "Server Url", "default": "http://localhost:5000", "type": "string"}' required={false}/><ClassPropertyRef name='streaming_url' details='{"title": "Streaming Url", "default": "http://localhost:5005", "type": "string"}' required={false}/><ClassPropertyRef name='verify_ssl' details='{"title": "Verify Ssl", "type": "boolean"}' required={false}/>
\ No newline at end of file diff --git a/docs/docs/reference/Models/together.md b/docs/docs/reference/Models/together.md new file mode 100644 index 00000000..e436644c --- /dev/null +++ b/docs/docs/reference/Models/together.md @@ -0,0 +1,11 @@ +import ClassPropertyRef from '@site/src/components/ClassPropertyRef.tsx'; + +# TogetherLLM + + + +[View the source](https://github.com/continuedev/continue/tree/main/continuedev/src/continuedev/libs/llm/together.py) + +## Properties + +<ClassPropertyRef name='api_key' details='{"title": "Api Key", "type": "string"}' required={true}/><ClassPropertyRef name='title' details='{"title": "Title", "type": "string"}' required={false}/><ClassPropertyRef name='system_message' details='{"title": "System Message", "type": "string"}' required={false}/><ClassPropertyRef name='context_length' details='{"title": "Context Length", "default": 2048, "type": "integer"}' required={false}/><ClassPropertyRef name='unique_id' details='{"title": "Unique Id", "type": "string"}' required={false}/><ClassPropertyRef name='model' details='{"title": "Model", "default": "togethercomputer/RedPajama-INCITE-7B-Instruct", "type": "string"}' required={false}/><ClassPropertyRef name='timeout' details='{"title": "Timeout", "default": 300, "type": "integer"}' required={false}/><ClassPropertyRef name='prompt_templates' details='{"title": "Prompt Templates", "default": {"edit": "[INST] Consider the following code:\n```\n{{code_to_edit}}\n```\nEdit the code to perfectly satisfy the following user request:\n{{user_input}}\nOutput nothing except for the code. No code block, no English explanation, no start/end tags.\n[/INST]"}, "type": "object"}' required={false}/><ClassPropertyRef name='base_url' details='{"title": "Base Url", "default": "https://api.together.xyz", "type": "string"}' required={false}/><ClassPropertyRef name='verify_ssl' details='{"title": "Verify Ssl", "type": "boolean"}' required={false}/>
\ No newline at end of file diff --git a/docs/sidebars.js b/docs/sidebars.js index 6d205bab..2121fea6 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -18,11 +18,40 @@ const sidebars = { "getting-started", "how-to-use-continue", "how-continue-works", - "customization", - "context-providers", + { + type: "category", + label: "Customization", + collapsible: true, + collapsed: false, + items: [ + "customization/models", + "customization/context-providers", + "customization/slash-commands", + "customization/other-configuration", + ], + }, "collecting-data", "telemetry", "troubleshooting", + { + type: "category", + label: "Walkthroughs", + collapsible: true, + collapsed: false, + items: ["walkthroughs/codellama"], + }, + { + type: "category", + label: "Reference", + collapsible: true, + collapsed: false, + items: [ + { + type: "autogenerated", + dirName: "reference", + }, + ], + }, ], }; diff --git a/docs/src/components/ClassPropertyRef.tsx b/docs/src/components/ClassPropertyRef.tsx new file mode 100644 index 00000000..46664c4c --- /dev/null +++ b/docs/src/components/ClassPropertyRef.tsx @@ -0,0 +1,26 @@ +import React from "react"; + +interface ClassPropertyRefProps { + name: string; + details: string; + required: boolean; +} + +export default function ClassPropertyRef(props: ClassPropertyRefProps) { + const details = JSON.parse(props.details); + + return ( + <> + <div> + <h4 style={{ display: "inline-block", marginRight: "10px" }}> + {props.name} + </h4> + <span style={{ color: "red", fontSize: "11px", marginRight: "4px" }}> + {props.required && "REQUIRED"} + </span> + <span>{details.type && `(${details.type})`}</span> + </div> + <p>{details.description}</p> + </> + ); +} diff --git a/test.py b/test.py deleted file mode 100644 index 5bd57e0e..00000000 --- a/test.py +++ /dev/null @@ -1,21 +0,0 @@ -import unittest - - -def sort_numbers(numbers): - for i in range(len(numbers)): - for j in range(i + 1, len(numbers)): - if numbers[i] > numbers[j]: - numbers[i], numbers[j] = numbers[j], numbers[i] - return numbers[:-1] # Error here: We're not returning the last number - - -class TestSortNumbers(unittest.TestCase): - def test_sort_numbers(self): - self.assertEqual(sort_numbers([3, 2, 1]), [1, 2, 3]) # This test will fail - self.assertEqual( - sort_numbers([4, 2, 5, 1, 3]), [1, 2, 3, 4, 5] - ) # This test will fail - - -if __name__ == "__main__": - unittest.main() |