Skip to content

Commit

Permalink
config: add default config for bitdeer (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini256 authored Apr 17, 2024
1 parent 2e67c91 commit 152b4e6
Showing 1 changed file with 121 additions and 0 deletions.
121 changes: 121 additions & 0 deletions ddl/override/bitdeer/1-initial-data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
-- Default Index Config
--

INSERT INTO `index` (id, name, config) VALUES (1, 'default', '{
"provider": "llamaindex",
"llm": {
"provider": "bitdeer",
"config": {
"model": "mistral",
"stream": false
}
},
"embedding": {
"provider": "bitdeer",
"config": {
"model": "mxbai-embed-large",
"vectorColumn": "embedding",
"vectorDimension": 1024
}
},
"metadata_extractors": [],
"parser": {
"textSplitter": {
"chunkSize": 512
}
},
"reader": {
"rag.loader.html": {
"contentExtraction": [
{
"excludeSelectors": [
{
"selector": ".header"
},
{
"selector": ".footer"
}
],
"url": "www.bitdeer.com/**"
}
]
}
}
}');

--
-- Default Chat Engine Config
--

INSERT INTO chat_engine (name, engine, engine_options, is_default) VALUE ('default', 'condense-question', '{}', true);

UPDATE `chat_engine`
SET engine_options = JSON_MERGE_PATCH(engine_options, '{
"index_id": 1,
"llm": {
"provider": "bitdeer",
"config": {
"model": "mistral",
"stream": false
}
},
"prompts":{
"condenseQuestion": "Given a conversation (between Human and Assistant) and a follow up message from Human, rewrite the message to be a standalone question that captures all relevant context from the conversation.\\n\\n<Chat History>\\n{{chatHistory}}\\n\\n<Follow Up Message>\\n{{question}}\\n\\n<Standalone question>\\n",
"refine": "The original query is as follows: {{query}}\\nWe have provided an existing answer: {{existingAnswer}}\\nWe have the opportunity to refine the existing answer (only if needed) with some more context below.\\n------------\\n{{context}}\\n------------\\nGiven the new context, refine the original answer to better answer the query. If the context isn''t useful, return the original answer.\\nRefined Answer:",
"textQa": "Context information is below.\\n---------------------\\n{{context}}\\n---------------------\\nGiven the context information and not prior knowledge, answer the query.\\nQuery: {{query}}\\nAnswer:"
},
"reranker": {},
"retriever": {
"search_top_k": 25,
"top_k": 7
}
}')
WHERE name = 'default';

--
-- Default Website Settings
--

-- Website Setting: General
INSERT INTO
`option`
VALUES
('title', 'website', 'string', '"Bitdeer"'),
('description', 'website', 'string', '"Hello Bitdeer!"'),
('logo_in_dark_mode', 'website', 'string', '"https://tidb.ai/tidb-ai-light.svg"'),
('logo_in_light_mode', 'website', 'string', '"https://tidb.ai/tidb-ai.svg"'),
('language', 'website', 'string', '"en-US"');

-- Website Setting: Homepage
INSERT INTO
`option`
VALUES
('homepage.title', 'website', 'string', '"Ask anything about Bitdeer"'),
('homepage.description', 'website', 'string', '"Including company intro, user cases, product intro and usage, FAQ, etc."'),
('homepage.example_questions', 'website', 'array', '[
{"text": "What is Bitdeer?"},
{"text": "Who use Bitdeer?"}
]'),
('homepage.footer_links', 'website', 'array', '[
{"text": "Docs", "href": "/docs"},
{"text": "Deploy your own within 5 minutes for free", "href": "/docs"},
{"text": "How it works?", "href": "/docs"},
{"text": "Powered by TiDB", "href": "https://tidb.cloud"},
{"text": "© 2024 PingCAP", "href": "https://pingcap.com"}
]');

-- Custom JS Setting
INSERT INTO
`option`
VALUES
('button_label', 'custom_js', 'string', '"Ask AI"'),
('button_img_src', 'custom_js', 'string', '"https://tidb.ai/tidb-ai.svg"'),
('logo_src', 'custom_js', 'string', '"https://tidb.ai/tidb-ai.svg"'),
('example_questions', 'custom_js', 'array', '[
{"text": "What is Bitdeer?"},
{"text": "Who use Bitdeer?"}
]'),
('widget_title', 'custom_js', 'string', '"Conversation Search Box"'),
('widget_input_placeholder', 'custom_js', 'string', '"Ask a question..."'),
('widget_color_mode', 'custom_js', 'string', '"system"');

0 comments on commit 152b4e6

Please sign in to comment.