fix lint issues

This commit is contained in:
Amruth Pillai
2025-01-11 12:07:30 +01:00
parent 8a401de5c9
commit 02ce1ad48c
8 changed files with 21 additions and 19 deletions

View File

@ -1,8 +1,3 @@
{
"recommendations": [
"nrwl.angular-console",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"firsttris.vscode-jest-runner"
]
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}

View File

@ -1,2 +1,2 @@
export const DEFAULT_MODEL = "gpt-3.5-turbo";
export const DEFAULT_MAX_TOKENS = 1024
export const DEFAULT_MAX_TOKENS = 1024;

View File

@ -16,18 +16,19 @@ import { cn } from "@reactive-resume/utils";
import { useForm } from "react-hook-form";
import { z } from "zod";
import { useOpenAiStore } from "@/client/stores/openai";
import { DEFAULT_MAX_TOKENS, DEFAULT_MODEL } from "@/client/constants/llm";
import { useOpenAiStore } from "@/client/stores/openai";
const formSchema = z.object({
apiKey: z
.string()
// eslint-disable-next-line lingui/t-call-in-function
.regex(/^sk-.+$/, t`That doesn't look like a valid OpenAI API key.`)
// eslint-disable-next-line lingui/no-unlocalized-strings
.regex(/^sk-.+$/, "That doesn't look like a valid OpenAI API key.")
.default(""),
baseURL: z
.string()
.regex(/https?:\/\/[^\/]+\/?v1$/, t`That doesn't look like a valid URL`)
// eslint-disable-next-line lingui/no-unlocalized-strings
.regex(/https?:\/\/[^/]+\/?v1$/, "That doesn't look like a valid URL")
.default(""),
model: z.string().default(DEFAULT_MODEL),
maxTokens: z.number().default(DEFAULT_MAX_TOKENS),
@ -162,7 +163,9 @@ export const OpenAISettings = () => {
type="number"
placeholder={`${DEFAULT_MAX_TOKENS}`}
{...field}
onChange={(e) => field.onChange(e.target.valueAsNumber)}
onChange={(e) => {
field.onChange(e.target.valueAsNumber);
}}
/>
</FormControl>
<FormMessage />

View File

@ -2,9 +2,10 @@
import { t } from "@lingui/macro";
import { openai } from "./client";
import { useOpenAiStore } from "@/client/stores/openai";
import { DEFAULT_MAX_TOKENS, DEFAULT_MODEL } from "@/client/constants/llm";
import { useOpenAiStore } from "@/client/stores/openai";
import { openai } from "./client";
const PROMPT = `You are an AI writing assistant specialized in writing copy for resumes.
Do not return anything else except the text you improved. It should not begin with a newline. It should not have any prefix or suffix text.

View File

@ -12,7 +12,7 @@ export const openai = () => {
);
}
if(baseURL) {
if (baseURL) {
return new OpenAI({
baseURL,
apiKey,

View File

@ -2,9 +2,10 @@
import { t } from "@lingui/macro";
import { openai } from "./client";
import { useOpenAiStore } from "@/client/stores/openai";
import { DEFAULT_MAX_TOKENS, DEFAULT_MODEL } from "@/client/constants/llm";
import { useOpenAiStore } from "@/client/stores/openai";
import { openai } from "./client";
const PROMPT = `You are an AI writing assistant specialized in writing copy for resumes.
Do not return anything else except the text you improved. It should not begin with a newline. It should not have any prefix or suffix text.

View File

@ -2,9 +2,10 @@
import { t } from "@lingui/macro";
import { openai } from "./client";
import { useOpenAiStore } from "@/client/stores/openai";
import { DEFAULT_MAX_TOKENS, DEFAULT_MODEL } from "@/client/constants/llm";
import { useOpenAiStore } from "@/client/stores/openai";
import { openai } from "./client";
const PROMPT = `You are an AI writing assistant specialized in writing copy for resumes.
Do not return anything else except the text you improved. It should not begin with a newline. It should not have any prefix or suffix text.

View File

@ -1,5 +1,6 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { DEFAULT_MAX_TOKENS, DEFAULT_MODEL } from "../constants/llm";
type OpenAIStore = {