|
|
@@ -1,10 +1,4 @@
|
|
|
-import { GrowiServiceType } from "~/features/questionnaire/interfaces/growi-info";
|
|
|
-
|
|
|
-interface ConfigDefinition<T> {
|
|
|
- envVarName: string;
|
|
|
- defaultValue: T;
|
|
|
- isSecret?: boolean;
|
|
|
-}
|
|
|
+import { GrowiServiceType } from '~/features/questionnaire/interfaces/growi-info';
|
|
|
|
|
|
/*
|
|
|
* Sort order for top level keys:
|
|
|
@@ -160,13 +154,23 @@ export const CONFIG_KEYS = [
|
|
|
'env:useAzureEnvVars',
|
|
|
] as const;
|
|
|
|
|
|
+
|
|
|
export type ConfigKey = (typeof CONFIG_KEYS)[number];
|
|
|
|
|
|
-// Safe accessor object
|
|
|
+interface ConfigDefinition<T> {
|
|
|
+ envVarName: string;
|
|
|
+ defaultValue: T;
|
|
|
+ isSecret?: boolean;
|
|
|
+}
|
|
|
|
|
|
type ValidateKeyFn = (key: unknown) => asserts key is ConfigKey;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Safe accessor object for ConfigKey
|
|
|
+ */
|
|
|
export const ConfigKeys = {
|
|
|
all: CONFIG_KEYS,
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
includes: (key: unknown): key is ConfigKey => CONFIG_KEYS.includes(key as any),
|
|
|
validateKey: ((key: unknown): asserts key is ConfigKey => {
|
|
|
if (!ConfigKeys.includes(key)) {
|
|
|
@@ -601,6 +605,7 @@ export const CONFIG_DEFINITIONS: ConfigDefinitions = {
|
|
|
},
|
|
|
|
|
|
// OpenAI Settings
|
|
|
+ /* eslint-disable max-len */
|
|
|
'openai:chatAssistantInstructions': {
|
|
|
envVarName: 'OPENAI_CHAT_ASSISTANT_INSTRUCTIONS',
|
|
|
defaultValue: `Response Length Limitation:
|
|
|
@@ -621,6 +626,7 @@ Multilingual Support:
|
|
|
Guideline as a RAG:
|
|
|
As this system is a Retrieval Augmented Generation (RAG) with GROWI knowledge base, focus on answering questions related to the effective use of GROWI and the content within the GROWI that are provided as vector store. If a user asks about information that can be found through a general search engine, politely encourage them to search for it themselves. Decline requests for content generation such as "write a novel" or "generate ideas," and explain that you are designed to assist with specific queries related to the RAG's content.`,
|
|
|
},
|
|
|
+ /* eslint-enable max-len */
|
|
|
'openai:assistantModel:chat': {
|
|
|
envVarName: 'OPENAI_CHAT_ASSISTANT_MODEL',
|
|
|
defaultValue: null,
|