Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): uniformize case for types #2071

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions frontend/lib/types/BrainConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { UUID } from "crypto";

import { ApiBrainDefinition } from "../api/brain/types";

export const brainStatuses = ["private", "public"] as const;

export type BrainStatus = (typeof brainStatuses)[number];

export const brainTypes = ["doc", "api", "composite"] as const;

export type BrainType = (typeof brainTypes)[number];

export type Model = (typeof freeModels)[number];

// TODO: update this type to match the backend (antropic, openai and some other keys should be removed)
export type BrainConfig = {
id: UUID;
model: Model;
temperature: number;
maxTokens: number;
keepLocal: boolean;
backendUrl?: string;
openAiKey?: string;
anthropicKey?: string;
supabaseUrl?: string;
supabaseKey?: string;
prompt_id?: string;
status: BrainStatus;
brain_type: BrainType;
prompt: {
title: string;
content: string;
};
name: string;
description: string;
} & {
brain_definition?: ApiBrainDefinition;
};

export const openAiFreeModels = [
"gpt-3.5-turbo",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-16k",
] as const;

export const openAiPaidModels = [...openAiFreeModels, "gpt-4"] as const;

export const anthropicModels = [
// "claude-v1",
// "claude-v1.3",
// "claude-instant-v1-100k",
// "claude-instant-v1.1-100k",
] as const;

export const googleModels = [
//"vertexai"
] as const; // TODO activate when not in demo mode

// export const googleModels = [] as const;
export const freeModels = [
...openAiFreeModels,
// ...anthropicModels,
// ...googleModels,
] as const;

export const paidModels = [...openAiPaidModels] as const;

export type PaidModels = (typeof paidModels)[number];
8 changes: 8 additions & 0 deletions frontend/lib/types/Testimonial.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export type Testimonial = {
socialMedia: "x" | "linkedin";
url: string;
jobTitle: string;
content: string;
name: string;
profilePicture?: string;
};
Loading