-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
374 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,39 @@ | ||
import LangChainBot from "../LangChainBot"; | ||
import { ChatOpenAI } from "@langchain/openai"; | ||
import store from "@/store/index"; | ||
|
||
export default class GitHubAPIBot extends LangChainBot { | ||
static _brandId = "gitHubApi"; // Brand id of the bot, should be unique. Used in i18n. | ||
static _className = "GitHubAPIBot"; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
|
||
async _checkAvailability() { | ||
let available = false; | ||
|
||
if (store.state.gitHubApi.apiKey) { | ||
this.setupModel(); | ||
available = true; | ||
} | ||
return available; | ||
} | ||
|
||
_setupModel() { | ||
const chatModel = new ChatOpenAI({ | ||
configuration: { | ||
basePath: "https://models.inference.ai.azure.com", | ||
}, | ||
openAIApiKey: store.state.gitHubApi.apiKey, | ||
modelName: this.constructor._model ? this.constructor._model : "", | ||
temperature: store.state.gitHubApi.temperature, | ||
streaming: true, | ||
}); | ||
return chatModel; | ||
} | ||
|
||
getPastRounds() { | ||
return store.state.gitHubApi.pastRounds; | ||
} | ||
} |
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,12 @@ | ||
import GitHubAPIBot from "./GitHubAPIBot"; | ||
|
||
export default class GitHubAPIGPT4oBot extends GitHubAPIBot { | ||
static _className = "GitHubAPIGPT4oBot"; | ||
static _model = "gpt-4o"; | ||
static _logoFilename = "openai-4o-github-logo.png"; // Place it in public/bots/ | ||
static _isDarkLogo = true; // The main color of logo is dark | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} |
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,12 @@ | ||
import GitHubAPIBot from "./GitHubAPIBot"; | ||
|
||
export default class GitHubAPIGPT4oMiniBot extends GitHubAPIBot { | ||
static _className = "GitHubAPIGPT4oMiniBot"; | ||
static _model = "gpt-4o-mini"; | ||
static _logoFilename = "openai-4o-mini-github-logo.png"; // Place it in public/bots/ | ||
static _isDarkLogo = true; // The main color of logo is dark | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} |
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,11 @@ | ||
import GitHubAPIBot from "./GitHubAPIBot"; | ||
|
||
export default class GitHubAPILlama31405bBot extends GitHubAPIBot { | ||
static _className = "GitHubAPILlama31405bBot"; | ||
static _model = "Meta-Llama-3.1-405B-Instruct"; | ||
static _logoFilename = "llama-31-405b-github-logo.png"; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} |
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,11 @@ | ||
import GitHubAPIBot from "./GitHubAPIBot"; | ||
|
||
export default class GitHubAPILlama3170bBot extends GitHubAPIBot { | ||
static _className = "GitHubAPILlama3170bBot"; | ||
static _model = "Meta-Llama-3.1-70B-Instruct"; | ||
static _logoFilename = "llama-31-70b-github-logo.png"; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} |
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,11 @@ | ||
import GitHubAPIBot from "./GitHubAPIBot"; | ||
|
||
export default class GitHubAPILlama318bBot extends GitHubAPIBot { | ||
static _className = "GitHubAPILlama318bBot"; | ||
static _model = "Meta-Llama-3.1-8B-Instruct"; | ||
static _logoFilename = "llama-31-8b-github-logo.png"; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} |
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,11 @@ | ||
import GitHubAPIBot from "./GitHubAPIBot"; | ||
|
||
export default class GitHubAPIMistralLargeBot extends GitHubAPIBot { | ||
static _className = "GitHubAPIMistralLargeBot"; | ||
static _model = "Mistral-large-2407"; | ||
static _logoFilename = "mistral-large-github-logo.png"; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} |
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,11 @@ | ||
import GitHubAPIBot from "./GitHubAPIBot"; | ||
|
||
export default class GitHubAPIMistralNemoBot extends GitHubAPIBot { | ||
static _className = "GitHubAPIMistralNemoBot"; | ||
static _model = "Mistral-nemo"; | ||
static _logoFilename = "mistral-nemo-github-logo.png"; | ||
|
||
constructor() { | ||
super(); | ||
} | ||
} |
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,63 @@ | ||
<template> | ||
<CommonBotSettings | ||
:settings="settings" | ||
:brand-id="brandId" | ||
mutation-type="setGitHubApi" | ||
:watcher="watcher" | ||
></CommonBotSettings> | ||
</template> | ||
|
||
<script> | ||
import Bot from "@/bots/github/GitHubAPIBot"; | ||
import CommonBotSettings from "@/components/BotSettings/CommonBotSettings.vue"; | ||
import { Type } from "./settings.const"; | ||
const settings = [ | ||
{ | ||
type: Type.Text, | ||
name: "apiKey", | ||
title: "common.apiKey", | ||
description: "settings.secretPrompt", | ||
placeholder: "sk-...", | ||
}, | ||
{ | ||
type: Type.Slider, | ||
name: "temperature", | ||
title: "openaiApi.temperature", | ||
description: "openaiApi.temperaturePrompt", | ||
default: 1.0, | ||
min: 0, | ||
max: 2, | ||
step: 0.05, | ||
ticks: { | ||
0: "openaiApi.temperature0", | ||
2: "openaiApi.temperature2", | ||
}, | ||
}, | ||
{ | ||
type: Type.Slider, | ||
name: "pastRounds", | ||
title: "bot.pastRounds", | ||
description: "bot.pastRoundsPrompt", | ||
min: 0, | ||
max: 10, | ||
step: 1, | ||
}, | ||
]; | ||
export default { | ||
components: { | ||
CommonBotSettings, | ||
}, | ||
data() { | ||
return { | ||
settings: settings, | ||
brandId: Bot._brandId, | ||
}; | ||
}, | ||
methods: { | ||
watcher() { | ||
Bot.getInstance().setupModel(); | ||
}, | ||
}, | ||
}; | ||
</script> |
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
Oops, something went wrong.