diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-09-02 12:06:52 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-09-02 12:06:52 -0700 |
commit | f057ee4d619b834dc245065d13417a86b44dc61b (patch) | |
tree | e8adf25bc3859aa78b2ee41a0327f4af53cf8892 | |
parent | 90590ab4e06fbc3fa721f73a4a922136946a756f (diff) | |
download | sncontinue-f057ee4d619b834dc245065d13417a86b44dc61b.tar.gz sncontinue-f057ee4d619b834dc245065d13417a86b44dc61b.tar.bz2 sncontinue-f057ee4d619b834dc245065d13417a86b44dc61b.zip |
fix: :bug: fix usages of LLM.complete
-rw-r--r-- | continuedev/src/continuedev/plugins/steps/README.md | 2 | ||||
-rw-r--r-- | continuedev/src/continuedev/plugins/steps/core/core.py | 10 | ||||
-rw-r--r-- | continuedev/src/continuedev/plugins/steps/main.py | 2 | ||||
-rw-r--r-- | docs/docs/concepts/sdk.md | 2 | ||||
-rw-r--r-- | docs/docs/customization.md | 2 | ||||
-rw-r--r-- | docs/docs/walkthroughs/create-a-recipe.md | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/continuedev/src/continuedev/plugins/steps/README.md b/continuedev/src/continuedev/plugins/steps/README.md index 3f2f804c..a248f19c 100644 --- a/continuedev/src/continuedev/plugins/steps/README.md +++ b/continuedev/src/continuedev/plugins/steps/README.md @@ -33,7 +33,7 @@ If you'd like to override the default description of your step, which is just th - Return a static string - Store state in a class attribute (prepend with a double underscore, which signifies (through Pydantic) that this is not a parameter for the Step, just internal state) during the run method, and then grab this in the describe method. -- Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return models.medium.complete(f"{self.\_\_code_written}\n\nSummarize the changes made in the above code.")`. +- Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return models.medium._complete(f"{self.\_\_code_written}\n\nSummarize the changes made in the above code.")`. Here's an example: diff --git a/continuedev/src/continuedev/plugins/steps/core/core.py b/continuedev/src/continuedev/plugins/steps/core/core.py index 9d40822b..df29a01e 100644 --- a/continuedev/src/continuedev/plugins/steps/core/core.py +++ b/continuedev/src/continuedev/plugins/steps/core/core.py @@ -107,7 +107,7 @@ class ShellCommandsStep(Step): return f"Error when running shell commands:\n```\n{self._err_text}\n```" cmds_str = "\n".join(self.cmds) - return await models.medium.complete( + return await models.medium._complete( f"{cmds_str}\n\nSummarize what was done in these shell commands, using markdown bullet points:" ) @@ -121,7 +121,7 @@ class ShellCommandsStep(Step): and output is not None and output_contains_error(output) ): - suggestion = await sdk.models.medium.complete( + suggestion = await sdk.models.medium._complete( dedent( f"""\ While running the command `{cmd}`, the following error occurred: @@ -220,7 +220,7 @@ class DefaultModelEditCodeStep(Step): self._new_contents.splitlines(), ) ) - description = await models.medium.complete( + description = await models.medium._complete( dedent( f"""\ Diff summary: "{self.user_input}" @@ -232,7 +232,7 @@ class DefaultModelEditCodeStep(Step): {self.summary_prompt}""" ) ) - name = await models.medium.complete( + name = await models.medium._complete( f"Write a very short title to describe this requested change (no quotes): '{self.user_input}'. This is the title:" ) self.name = remove_quotes_and_escapes(name) @@ -874,7 +874,7 @@ class ManualEditStep(ReversibleStep): return "Manual edit step" # TODO - only handling FileEdit here, but need all other types of FileSystemEdits # Also requires the merge_file_edit function - # return llm.complete(dedent(f"""This code was replaced: + # return llm._complete(dedent(f"""This code was replaced: # {self.edit_diff.backward.replacement} diff --git a/continuedev/src/continuedev/plugins/steps/main.py b/continuedev/src/continuedev/plugins/steps/main.py index 7762666c..cecd3a2a 100644 --- a/continuedev/src/continuedev/plugins/steps/main.py +++ b/continuedev/src/continuedev/plugins/steps/main.py @@ -213,7 +213,7 @@ class StarCoderEditHighlightedCodeStep(Step): segs = full_file_contents.split(rif.contents) prompt = f"<file_prefix>{segs[0]}<file_suffix>{segs[1]}" + prompt - completion = str(await sdk.models.starcoder.complete(prompt)) + completion = str(await sdk.models.starcoder._complete(prompt)) eot_token = "<|endoftext|>" completion = completion.removesuffix(eot_token) diff --git a/docs/docs/concepts/sdk.md b/docs/docs/concepts/sdk.md index 21190aa8..ac2bc8bf 100644 --- a/docs/docs/concepts/sdk.md +++ b/docs/docs/concepts/sdk.md @@ -23,7 +23,7 @@ The **Continue SDK** gives you all the tools you need to automate software devel ### `sdk.models`
-`sdk.models` is an instance of the `Models` class, containing many of the most commonly used LLMs or other foundation models. You can access a model (starcoder for example) like `starcoder = sdk.models.starcoder`. Right now, all of the models are `LLM`s, meaning that they offer the `complete` method, used like `bubble_sort_code = await starcoder.complete("# Write a bubble sort function below, in Python:\n")`.
+`sdk.models` is an instance of the `Models` class, containing many of the most commonly used LLMs or other foundation models. You can access a model (starcoder for example) like `starcoder = sdk.models.starcoder`. Right now, all of the models are `LLM`s, meaning that they offer the `complete` method, used like `bubble_sort_code = await starcoder._complete("# Write a bubble sort function below, in Python:\n")`.
### `sdk.history`
diff --git a/docs/docs/customization.md b/docs/docs/customization.md index be28a30d..37328327 100644 --- a/docs/docs/customization.md +++ b/docs/docs/customization.md @@ -265,7 +265,7 @@ class CommitMessageStep(Step): # Ask the LLM to write a commit message, # and set it as the description of this step - self.description = await sdk.models.default.complete( + self.description = await sdk.models.default._complete( f"{diff}\n\nWrite a short, specific (less than 50 chars) commit message about the above changes:") config=ContinueConfig( diff --git a/docs/docs/walkthroughs/create-a-recipe.md b/docs/docs/walkthroughs/create-a-recipe.md index 2cb28f77..cc80be0e 100644 --- a/docs/docs/walkthroughs/create-a-recipe.md +++ b/docs/docs/walkthroughs/create-a-recipe.md @@ -31,7 +31,7 @@ If you'd like to override the default description of your steps, which is just t - Return a static string
- Store state in a class attribute (prepend with a double underscore, which signifies (through Pydantic) that this is not a parameter for the Step, just internal state) during the run method, and then grab this in the describe method.
-- Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return models.medium.complete(f"{self.\_\_code_written}\n\nSummarize the changes made in the above code.")`.
+- Use state in conjunction with the `models` parameter of the describe method to autogenerate a description with a language model. For example, if you'd used an attribute called `__code_written` to store a string representing some code that was written, you could implement describe as `return models.medium._complete(f"{self.\_\_code_written}\n\nSummarize the changes made in the above code.")`.
## 2. Compose steps together into a complete recipe
|