Skip to content

Commit

Permalink
fix(frontend): uniformize case for types (#2071)
Browse files Browse the repository at this point in the history
# 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):
  • Loading branch information
Zewed authored Jan 23, 2024
1 parent b5e2d5a commit 08474ea
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
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;
};

0 comments on commit 08474ea

Please sign in to comment.