Merge pull request #4922 from continuedev/dallin/context-block-name
Optional context block name
This commit is contained in:
commit
86fc2ee435
7 changed files with 23 additions and 11 deletions
|
|
@ -395,7 +395,10 @@ async function configYamlToContinueConfig({
|
|||
}
|
||||
return undefined;
|
||||
}
|
||||
const instance: IContextProvider = new cls(context.params ?? {});
|
||||
const instance: IContextProvider = new cls({
|
||||
name: context.name,
|
||||
...context.params,
|
||||
});
|
||||
return instance;
|
||||
})
|
||||
.filter((p) => !!p) ?? []) as IContextProvider[];
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class ContinueProxyContextProvider extends BaseContextProvider {
|
|||
this.options.title || ContinueProxyContextProvider.description.title,
|
||||
displayTitle:
|
||||
this.options.displayTitle ||
|
||||
this.options.name ||
|
||||
ContinueProxyContextProvider.description.displayTitle,
|
||||
description:
|
||||
this.options.description ||
|
||||
|
|
|
|||
|
|
@ -16,18 +16,20 @@ class HttpContextProvider extends BaseContextProvider {
|
|||
|
||||
override get description(): ContextProviderDescription {
|
||||
return {
|
||||
title: this.options.title || "http",
|
||||
displayTitle: this.options.displayTitle || "HTTP",
|
||||
title: this.options.title || HttpContextProvider.description.title,
|
||||
displayTitle:
|
||||
this.options.displayTitle ||
|
||||
this.options.name ||
|
||||
HttpContextProvider.description.displayTitle,
|
||||
description:
|
||||
this.options.description ||
|
||||
"Retrieve a context item from a custom server",
|
||||
type: "normal",
|
||||
this.options.description || HttpContextProvider.description.description,
|
||||
type: HttpContextProvider.description.type,
|
||||
renderInlineAs:
|
||||
this.options.renderInlineAs ||
|
||||
HttpContextProvider.description.renderInlineAs,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
async getContextItems(
|
||||
query: string,
|
||||
extras: ContextProviderExtras,
|
||||
|
|
|
|||
|
|
@ -237,7 +237,8 @@ More information about usage/params for each context provider can be found [here
|
|||
|
||||
**Properties:**
|
||||
|
||||
- `provider` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`).
|
||||
- `provider` (**required**): The identifier or name of the context provider (e.g., `code`, `docs`, `web`)
|
||||
- `name`: Optional name for the provider
|
||||
- `params`: Optional parameters to configure the context provider's behavior.
|
||||
|
||||
**Example:**
|
||||
|
|
@ -251,6 +252,10 @@ context:
|
|||
nFinal: 10
|
||||
- provider: docs
|
||||
- provider: diff
|
||||
- provider: http
|
||||
name: Context Server 1
|
||||
params:
|
||||
url: "https://api.example.com/server1"
|
||||
- provider: folder
|
||||
- provider: terminal
|
||||
```
|
||||
|
|
|
|||
4
packages/config-yaml/package-lock.json
generated
4
packages/config-yaml/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.78",
|
||||
"version": "1.0.87",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.78",
|
||||
"version": "1.0.87",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.78",
|
||||
"version": "1.0.87",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { dataSchema } from "./data/index.js";
|
|||
import { modelSchema, partialModelSchema } from "./models.js";
|
||||
|
||||
export const contextSchema = z.object({
|
||||
name: z.string().optional(),
|
||||
provider: z.string(),
|
||||
params: z.any().optional(),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue