mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-10 04:22:27 +10:00
fix lint issues
This commit is contained in:
7
.vscode/extensions.json
vendored
7
.vscode/extensions.json
vendored
@ -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"]
|
||||
}
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
export const DEFAULT_MODEL = "gpt-3.5-turbo";
|
||||
export const DEFAULT_MAX_TOKENS = 1024
|
||||
export const DEFAULT_MAX_TOKENS = 1024;
|
||||
|
||||
@ -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 />
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -12,7 +12,7 @@ export const openai = () => {
|
||||
);
|
||||
}
|
||||
|
||||
if(baseURL) {
|
||||
if (baseURL) {
|
||||
return new OpenAI({
|
||||
baseURL,
|
||||
apiKey,
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
|
||||
import { DEFAULT_MAX_TOKENS, DEFAULT_MODEL } from "../constants/llm";
|
||||
|
||||
type OpenAIStore = {
|
||||
|
||||
Reference in New Issue
Block a user