feat: Add context argument to completion handlers
This commit adds a `context` argument to the completion handlers in `PromptsTab`, `ResourcesTab`, `useCompletionState`, and `useConnection`. The context argument allows passing additional information to the completion engine, which can be used to improve the quality of the completions. The context is passed as a dictionary of key-value pairs. The `ResourcesTab` component was also updated to pass `templateValues` as the `context` to the completion handler. The `useConnection` hook was updated to include the context in the completion request sent to the server.
This commit is contained in:
parent
56ef795d86
commit
de474e5411
2 changed files with 16 additions and 0 deletions
|
|
@ -48,6 +48,7 @@ const PromptsTab = ({
|
|||
ref: PromptReference | ResourceReference,
|
||||
argName: string,
|
||||
value: string,
|
||||
context?: Record<string, string>,
|
||||
) => Promise<string[]>;
|
||||
completionsSupported: boolean;
|
||||
promptContent: string;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ const ResourcesTab = ({
|
|||
ref: ResourceReference | PromptReference,
|
||||
argName: string,
|
||||
value: string,
|
||||
context?: Record<string, string>,
|
||||
) => Promise<string[]>;
|
||||
completionsSupported: boolean;
|
||||
resourceContent: string;
|
||||
|
|
@ -94,6 +95,7 @@ const ResourcesTab = ({
|
|||
},
|
||||
key,
|
||||
value,
|
||||
templateValues,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue