forked from eclipse-theia/theia
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements AI LLM support via optionally consumable Theia extensions. The base functionality is provided by the following extensions: - @theia/ai-core - @theia/ai-chat - @theia/ai-chat-ui 'ai-core' contains the basic LLM integration and defines the core concepts for interacting with LLM via agents, prompts and variables. 'ai-chat' builts on top to define a model for chat like conversations. 'ai-chat-ui' provides the actual Chat UI. The AI integration was built from the ground up to be flexible, inspectible, customizable and configurable. This feature is still highly experimental. Therefore, even when the AI extensions are included in a Theia based application, they are turned off by default and need to be enabled in the preferences. The preferences include a convenient "Turn all AI features on/off" setting. Additional features and integrations are offered by the remaining extensions: - @theia/ai-history - @theia/ai-code-completion - @theia/ai-terminal - @theia/ai-workspace-agent - @theia/ai-openai 'ai-history' offers a service to record requests and responses. The recordings can be inspected via the 'AI History View'. 'ai-code-completion' offers AI based code completion via completion items and inline suggestions. 'ai-terminal' offers a specialized AI for the Theia terminal which will suggest commands to execute. 'ai-workspace-agent' is a specialized agent which is able to inspect the current workspace content for context specific questions. 'ai-openai' integrates the LLM offerings of Open AI into Theia. Co-authored-by: Alexandra Muntean <[email protected]> Co-authored-by: Camille Letavernier <[email protected]> Co-authored-by: Christian W. Damus <[email protected]> Co-authored-by: Eugen Neufeld <[email protected]> Co-authored-by: Haydar Metin <[email protected]> Co-authored-by: Johannes Faltermeier <[email protected]> Co-authored-by: Jonas Helming <[email protected]> Co-authored-by: Lucas Koehler <[email protected]> Co-authored-by: Martin Fleck <[email protected]> Co-authored-by: Maximilian Koegel <[email protected]> Co-authored-by: Nina Doschek <[email protected]> Co-authored-by: Olaf Lessenich <[email protected]> Co-authored-by: Philip Langer <[email protected]> Co-authored-by: Remi Schnekenburger <[email protected]> Co-authored-by: Simon Graband <[email protected]> Co-authored-by: Tobias Ortmayr <[email protected]>
- Loading branch information
1 parent
a9345da
commit 0bc2bd9
Showing
161 changed files
with
12,738 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
extends: [ | ||
'../../configs/build.eslintrc.json' | ||
], | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: 'tsconfig.json' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<div align='center'> | ||
|
||
<br /> | ||
|
||
<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' /> | ||
|
||
<h2>ECLIPSE THEIA - AI Chat UI EXTENSION</h2> | ||
|
||
<hr /> | ||
|
||
</div> | ||
|
||
## Description | ||
|
||
The `@theia/ai-chat-ui` extension contributes the `AI Chat` view.\ | ||
The `AI Chat view` can be used to easily communicate with a language model. | ||
|
||
It is based on `@theia/ai-chat`. | ||
|
||
## Additional Information | ||
|
||
- [Theia - GitHub](https://github.com/eclipse-theia/theia) | ||
- [Theia - Website](https://theia-ide.org/) | ||
|
||
## License | ||
|
||
- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/) | ||
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp) | ||
|
||
## Trademark | ||
"Theia" is a trademark of the Eclipse Foundation | ||
https://www.eclipse.org/theia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"name": "@theia/ai-chat-ui", | ||
"version": "1.52.0", | ||
"description": "Theia - AI Chat UI Extension", | ||
"dependencies": { | ||
"@theia/ai-core": "1.52.0", | ||
"@theia/ai-chat": "1.52.0", | ||
"@theia/core": "1.52.0", | ||
"@theia/editor": "1.52.0", | ||
"@theia/filesystem": "1.52.0", | ||
"@theia/monaco": "1.52.0", | ||
"@theia/monaco-editor-core": "1.83.101", | ||
"@theia/editor-preview": "1.52.0", | ||
"@theia/workspace": "1.52.0", | ||
"minimatch": "^5.1.0", | ||
"tslib": "^2.6.2", | ||
"uuid": "^9.0.1" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"theiaExtensions": [ | ||
{ | ||
"frontend": "lib/browser/aichat-ui-frontend-module", | ||
"secondaryWindow": "lib/browser/aichat-ui-frontend-module" | ||
} | ||
], | ||
"keywords": [ | ||
"theia-extension" | ||
], | ||
"license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/eclipse-theia/theia.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/eclipse-theia/theia/issues" | ||
}, | ||
"homepage": "https://github.com/eclipse-theia/theia", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"scripts": { | ||
"build": "theiaext build", | ||
"clean": "theiaext clean", | ||
"compile": "theiaext compile", | ||
"lint": "theiaext lint", | ||
"test": "theiaext test", | ||
"watch": "theiaext watch" | ||
}, | ||
"devDependencies": { | ||
"@theia/ext-scripts": "1.52.0" | ||
}, | ||
"nyc": { | ||
"extends": "../../configs/nyc.json" | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
packages/ai-chat-ui/src/browser/ai-chat-command-contribution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// ***************************************************************************** | ||
// Copyright (C) 2024 EclipseSource GmbH. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License v. 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0. | ||
// | ||
// This Source Code may also be made available under the following Secondary | ||
// Licenses when the conditions for such availability set forth in the Eclipse | ||
// Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
// with the GNU Classpath Exception which is available at | ||
// https://www.gnu.org/software/classpath/license.html. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 | ||
// ***************************************************************************** | ||
|
||
import { COMMAND_CHAT_RESPONSE_COMMAND } from '@theia/ai-chat/lib/common'; | ||
import { Command, CommandContribution, CommandRegistry } from '@theia/core'; | ||
import { injectable } from '@theia/core/shared/inversify'; | ||
|
||
export interface AIChatCommandArguments { | ||
command: Command; | ||
handler?: (...commandArgs: unknown[]) => Promise<void>; | ||
arguments?: unknown[]; | ||
} | ||
|
||
@injectable() | ||
export class AIChatCommandContribution implements CommandContribution { | ||
|
||
registerCommands(commands: CommandRegistry): void { | ||
commands.registerCommand(COMMAND_CHAT_RESPONSE_COMMAND, { | ||
execute: async (arg: AIChatCommandArguments) => { | ||
if (arg.handler) { | ||
arg.handler(); | ||
} else { | ||
console.error(`No handle available which is necessary when using the default command '${COMMAND_CHAT_RESPONSE_COMMAND.id}'.`); | ||
} | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.