Skip to content
Snippets Groups Projects
Commit b46d050f authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

fix: format

parent 02ed277d
No related branches found
No related tags found
No related merge requests found
...@@ -3,11 +3,7 @@ import prompts from "prompts"; ...@@ -3,11 +3,7 @@ import prompts from "prompts";
import { ModelConfigParams } from "."; import { ModelConfigParams } from ".";
import { questionHandlers, toChoice } from "../../questions"; import { questionHandlers, toChoice } from "../../questions";
const MODELS = [ const MODELS = ["llama3-8b", "llama3-70b", "mixtral-8x7b"];
"llama3-8b",
"llama3-70b",
"mixtral-8x7b",
];
const DEFAULT_MODEL = MODELS[0]; const DEFAULT_MODEL = MODELS[0];
// Use huggingface embedding models for now as Groq doesn't support embedding models // Use huggingface embedding models for now as Groq doesn't support embedding models
......
...@@ -3,8 +3,8 @@ import prompts from "prompts"; ...@@ -3,8 +3,8 @@ import prompts from "prompts";
import { questionHandlers } from "../../questions"; import { questionHandlers } from "../../questions";
import { ModelConfig, ModelProvider } from "../types"; import { ModelConfig, ModelProvider } from "../types";
import { askAnthropicQuestions } from "./anthropic"; import { askAnthropicQuestions } from "./anthropic";
import { askGroqQuestions } from "./groq";
import { askGeminiQuestions } from "./gemini"; import { askGeminiQuestions } from "./gemini";
import { askGroqQuestions } from "./groq";
import { askOllamaQuestions } from "./ollama"; import { askOllamaQuestions } from "./ollama";
import { askOpenAIQuestions } from "./openai"; import { askOpenAIQuestions } from "./openai";
......
import { PackageManager } from "../helpers/get-pkg-manager"; import { PackageManager } from "../helpers/get-pkg-manager";
import { Tool } from "./tools"; import { Tool } from "./tools";
export type ModelProvider = "openai" | "groq" | "ollama" | "anthropic" | "gemini"; export type ModelProvider =
| "openai"
| "groq"
| "ollama"
| "anthropic"
| "gemini";
export type ModelConfig = { export type ModelConfig = {
provider: ModelProvider; provider: ModelProvider;
apiKey?: string; apiKey?: string;
......
...@@ -4,15 +4,14 @@ import { ...@@ -4,15 +4,14 @@ import {
GEMINI_MODEL, GEMINI_MODEL,
Gemini, Gemini,
GeminiEmbedding, GeminiEmbedding,
OpenAI,
Groq, Groq,
OpenAI,
OpenAIEmbedding, OpenAIEmbedding,
Settings, Settings,
} from "llamaindex"; } from "llamaindex";
import { HuggingFaceEmbedding } from "llamaindex/embeddings/HuggingFaceEmbedding"; import { HuggingFaceEmbedding } from "llamaindex/embeddings/HuggingFaceEmbedding";
import { OllamaEmbedding } from "llamaindex/embeddings/OllamaEmbedding"; import { OllamaEmbedding } from "llamaindex/embeddings/OllamaEmbedding";
import { ALL_AVAILABLE_ANTHROPIC_MODELS } from "llamaindex/llm/anthropic"; import { ALL_AVAILABLE_ANTHROPIC_MODELS } from "llamaindex/llm/anthropic";
import { ALL_AVAILABLE_GROQ_MODELS } from "llamaindex/llm/groq";
import { Ollama } from "llamaindex/llm/ollama"; import { Ollama } from "llamaindex/llm/ollama";
const CHUNK_SIZE = 512; const CHUNK_SIZE = 512;
...@@ -90,7 +89,6 @@ function initAnthropic() { ...@@ -90,7 +89,6 @@ function initAnthropic() {
}); });
} }
function initGroq() { function initGroq() {
const embedModelMap: Record<string, string> = { const embedModelMap: Record<string, string> = {
"all-MiniLM-L6-v2": "Xenova/all-MiniLM-L6-v2", "all-MiniLM-L6-v2": "Xenova/all-MiniLM-L6-v2",
...@@ -98,10 +96,10 @@ function initGroq() { ...@@ -98,10 +96,10 @@ function initGroq() {
}; };
const modelMap: Record<string, string> = { const modelMap: Record<string, string> = {
"llama3-8b": "llama3-8b-8192", "llama3-8b": "llama3-8b-8192",
"llama3-70b": "llama3-70b-8192", "llama3-70b": "llama3-70b-8192",
"mixtral-8x7b": "mixtral-8x7b-32768", "mixtral-8x7b": "mixtral-8x7b-32768",
} };
Settings.llm = new Groq({ Settings.llm = new Groq({
model: modelMap[process.env.MODEL!], model: modelMap[process.env.MODEL!],
......
...@@ -82,10 +82,10 @@ function initGroq() { ...@@ -82,10 +82,10 @@ function initGroq() {
}; };
const modelMap: Record<string, string> = { const modelMap: Record<string, string> = {
"llama3-8b": "llama3-8b-8192", "llama3-8b": "llama3-8b-8192",
"llama3-70b": "llama3-70b-8192", "llama3-70b": "llama3-70b-8192",
"mixtral-8x7b": "mixtral-8x7b-32768", "mixtral-8x7b": "mixtral-8x7b-32768",
} };
Settings.llm = new Groq({ Settings.llm = new Groq({
model: modelMap[process.env.MODEL!], model: modelMap[process.env.MODEL!],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment