From 08474eab8a08b1d6a8f26c9ee245a6e3154d4960 Mon Sep 17 00:00:00 2001 From: Antoine Dewez <44063631+Zewed@users.noreply.github.com> Date: Mon, 22 Jan 2024 18:32:47 -0800 Subject: [PATCH] fix(frontend): uniformize case for types (#2071) # Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): --- frontend/lib/types/BrainConfig.ts | 68 +++++++++++++++++++++++++++++++ frontend/lib/types/Testimonial.ts | 8 ++++ 2 files changed, 76 insertions(+) create mode 100644 frontend/lib/types/BrainConfig.ts create mode 100644 frontend/lib/types/Testimonial.ts diff --git a/frontend/lib/types/BrainConfig.ts b/frontend/lib/types/BrainConfig.ts new file mode 100644 index 000000000000..4a85d1d23e72 --- /dev/null +++ b/frontend/lib/types/BrainConfig.ts @@ -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]; diff --git a/frontend/lib/types/Testimonial.ts b/frontend/lib/types/Testimonial.ts new file mode 100644 index 000000000000..43f483bfb130 --- /dev/null +++ b/frontend/lib/types/Testimonial.ts @@ -0,0 +1,8 @@ +export type Testimonial = { + socialMedia: "x" | "linkedin"; + url: string; + jobTitle: string; + content: string; + name: string; + profilePicture?: string; +};