Skip to content

Commit

Permalink
Merge pull request #23 from arbs-io/feature/20230320-HighlightCode
Browse files Browse the repository at this point in the history
Feature/20230320 highlight code
  • Loading branch information
arbs-io authored Mar 20, 2023
2 parents f2f6608 + 486525c commit b2c25ca
Show file tree
Hide file tree
Showing 9 changed files with 1,213 additions and 45 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ Simply enter your OpenAI Api-Key and enjoy the productivity.

## What features are provided

### Chatbot

The vscode-openai extension provides direct access to chatbot features directly from within your code editor. Say goodbye to switching back and forth between different applications to get answers to your questions - now you can get instant responses without leaving your coding environment.

Our chatbot features are designed to make your coding experience smoother by providing quick answers to your coding questions. Whether you need help with syntax or debugging or want to learn more about a specific topic, our chatbot is here to assist you. We provide accurate and timely responses, so you can stay focused on your work without interruption.

With the ChatBot Extension for Visual Studio Code, you can get the answers you need right when you need them, without any distractions. So why not give it a try? Download our extension today and experience the convenience of having a chatbot at your fingertips while coding.

![vscode-openai-chatbot.png](images/vscode-openai-chatbot.png)

### Bug Bounty

One of the critical features of vscode-openai is its powerful bug-finding capabilities. With this feature, you can easily select a method, and the extension will analyze your code, highlighting any potential bugs that could cause issues down the line. This functionality enables you to proactively identify and correct errors, improving your codebase's overall quality and reliability. By leveraging this tool, you can ensure that your software runs at peak performance and delivers the best possible experience for end-users.
Expand Down Expand Up @@ -63,7 +73,6 @@ The repo is not "Public" but will be in the future. This extension is still in f

The features in development are:

- General Prompt (ChatBot)
- Prompt Developer
- Embedding Analysis (Debugging vectors)
- More Developer Features
Binary file added images/vscode-openai-chatbot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-openai",
"displayName": "vscode-openai",
"description": "A vscode extension can significantly enhance your productivity and efficiency when developing complex software applications using OpenAI latest models",
"version": "1.0.3",
"version": "1.0.4",
"publisher": "AndrewButson",
"icon": "images/logo_128x128.png",
"private": true,
Expand Down
46 changes: 11 additions & 35 deletions src/contexts/conversationService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as crypto from 'crypto'
import { EventEmitter, Event, ExtensionContext } from 'vscode'
import { GlobalStorageService } from '../vscodeUtilities'
import { IConversation, IPersonaOpenAI } from '../interfaces'
import { IChatMessage, IConversation, IPersonaOpenAI } from '../interfaces'
import { MessageViewerPanel } from '../panels'

export default class ConversationService {
Expand Down Expand Up @@ -75,12 +75,21 @@ export default class ConversationService {

public create(persona: IPersonaOpenAI) {
const uuid4 = crypto.randomUUID()

const chatThreads: IChatMessage[] = []
chatThreads.push({
content: `Welcome! I'm vscode-openai, an AI language model based on OpenAI. I have been designed to assist you with all your technology needs. Whether you're looking for help with programming, troubleshooting technical issues, or just want to stay up-to-date with the latest developments in the industry, I'm here to provide the information you need.`,
author: `${persona.roleName} (${persona.configuration.service})`,
timestamp: new Date().toLocaleString(),
mine: false,
})

const conversation: IConversation = {
timestamp: new Date().getTime(),
conversationId: uuid4,
persona: persona,
summary: '<New Conversation>',
chatMessages: [],
chatMessages: chatThreads,
}

GlobalStorageService.instance.setValue<IConversation>(
Expand All @@ -92,36 +101,3 @@ export default class ConversationService {
ConversationService._emitterDidChange.fire()
}
}

/**
*
* Event Model: personaWebviewProvider
* | source | target | command | model |
* |-----------|-----------|-------------------------------|-----------------|
* | extension | webview | rqstViewLoadPersonas | IPersonaOpenAI[] |
* | webview | extension | rcvdViewNewConversation | IPersonaOpenAI |
*
* Event Model: conversationsWebviewProvider
* | source | target | command | model |
* |-----------|-----------|-------------------------------|-----------------|
* | extension | webview | rqstViewLoadConversations | IConversation[] |
* | webview | extension | rcvdViewDeleteConversation | IConversation |
*
* Event Model: MessageViewerPanel
* | source | target | command | model |
* |-----------|-----------|-------------------------------|-----------------|
* | extension | webview | rqstViewRenderMessages | IConversation |
* | extension | webview | rqstViewAnswerMessage | IChatMessage |
* | webview | extension | rcvdViewSaveMessages | IChatMessage[] |
* | webview | extension | rcvdViewQuestionMessage | IChatMessage |
*
Conversations
- New
- Delete(key)
Conversation
- newQuestion
- onQuestionAnswered
*/
2 changes: 1 addition & 1 deletion src/panels/messageViewerPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class MessageViewerPanel {
//Note: rcvdViewSaveMessages has added the new question
messageCompletion(this._conversation).then((result) => {
const author = `${this._conversation?.persona.roleName} (${this._conversation?.persona.configuration.service})`

console.log(`result\n:${result}`)
const chatThread: IChatMessage = {
content: result,
author: author,
Expand Down
Loading

0 comments on commit b2c25ca

Please sign in to comment.