+
AI is thinking...
-
Stop
+
Stop
)}
>
-
+
diff --git a/src/components/Header.astro b/src/components/Header.astro
index 589d3d7d0..3258895dd 100644
--- a/src/components/Header.astro
+++ b/src/components/Header.astro
@@ -9,8 +9,7 @@ import Themetoggle from './Themetoggle.astro'
- ChatGPT
- Demo
+ Program AI Tools
Based on OpenAI API (gpt-3.5-turbo).
diff --git a/src/components/SwitchPrompt.tsx b/src/components/SwitchPrompt.tsx
new file mode 100644
index 000000000..5e62e2ba2
--- /dev/null
+++ b/src/components/SwitchPrompt.tsx
@@ -0,0 +1,38 @@
+import { Select } from '@thisbeyond/solid-select'
+import '@thisbeyond/solid-select/style.css'
+import './style.css'
+
+interface IProps {
+ onChange: (value: string) => void
+}
+
+const prompt = {
+ 'Custom prompt': '',
+ 'Write js code': '接下来你需要扮演一个编程专家,我会将需求发给你,你需要告诉我如何用 javascript 实现。',
+ 'Explain code': '接下来你需要扮演一个编程专家,我会将代码发给你,只需要为我解释这段代码做了什么。',
+ 'Write unit test use jest': '你现在是一个编程专家,接下来我会将代码发给你,请帮我使用 jest 写一个单元测试,请至少提供五个测试案例,同时要包含到极端的状况,让我能够确定这段程式码的输出是正确的。',
+ 'Refactor code': '你现在是一个 Clean Code 专家,我会将代码发给你,请用更干净简洁的方式改写,让我的同事们可以更容易维护。另外,也解释为什么你要这样重构,让我能把重构的方式的说明加到 Pull Request 当中。',
+ 'Code review': '接下来你需要扮演一个编程专家,我会将代码发给你,你需要帮我仔细的 review 代码并给出意见',
+ 'Json to ts interface': '接下来我会把 json 发给你,你需要帮我生成对应的 typescript 类型',
+ 'Regex': '你现在是一个 Regex 专家,我会将需求发给你,请帮我写一个 Regex',
+ 'Translate to english or chinese': '我需要你帮我完成翻译的工作。接下来如果我发给你中文,你需要翻译成英文。如果我发给你英文,你需要翻译成中文',
+}
+
+const SwitchPrompt = (props: IProps) => {
+ return (
+
+
+ )
+}
+
+export default SwitchPrompt
diff --git a/src/components/style.css b/src/components/style.css
new file mode 100644
index 000000000..3b3ff156a
--- /dev/null
+++ b/src/components/style.css
@@ -0,0 +1,4 @@
+.custom .solid-select-list {
+ z-index: 100;
+ opacity: 1;
+}
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index b77394598..037c3b71a 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -53,9 +53,9 @@ const { title } = Astro.props;
}
main {
- max-width: 70ch;
+ max-width: 80ch;
margin: 0 auto;
- padding: 6rem 2rem 4rem;
+ padding: 3rem 2rem 2rem;
}
::-webkit-scrollbar {
diff --git a/src/pages/index.astro b/src/pages/index.astro
index 76f6a7ccd..bc4ccaf08 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -9,7 +9,7 @@ import 'katex/dist/katex.min.css'
import 'highlight.js/styles/atom-one-dark.css'
---
-
+