Skip to content

Commit 46aca68

Browse files
author
Rankin Zheng
authored
Merge pull request #3 from devchat-ai/remove_cost_confirm
Remove cost confirm
2 parents 1149be9 + ff4a8ce commit 46aca68

3 files changed

Lines changed: 6 additions & 60 deletions

File tree

src/views/components/MessageList/index.tsx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ const MessageList = observer((props: any) => {
5959
type: messageType,
6060
hash: messageHash,
6161
contexts,
62-
confirm,
6362
} = item;
6463
// setMessage(messageText);
6564
return (
@@ -89,46 +88,6 @@ const MessageList = observer((props: any) => {
8988
},
9089
}}
9190
>
92-
{messageType === "bot" && confirm && (
93-
<Card
94-
shadow="sm"
95-
padding="xs"
96-
radius="md"
97-
withBorder
98-
className={classes.card}
99-
>
100-
<Card.Section withBorder inheritPadding py="xs">
101-
<Group position="left">
102-
<IconInfoSquareRounded size={20} />
103-
<Text fw={500}>GPT-4 Usage Required</Text>
104-
</Group>
105-
</Card.Section>
106-
<Text className={classes.cardDescription}>
107-
DevChat will make GPT-4 API calls to analyze up to ten
108-
source files, costing{" "}
109-
<strong>approximately $0.4 USD per question</strong>.
110-
<br />
111-
<br />
112-
Would you like to proceed?
113-
</Text>
114-
<Group position="right">
115-
<Button
116-
size="compact-xs"
117-
className={classes.button}
118-
onClick={() => chat.sendLastUserMessage()}
119-
>
120-
Yes
121-
</Button>
122-
<Button
123-
size="compact-xs"
124-
className={classes.button}
125-
onClick={() => chat.cancelDevchatAsk()}
126-
>
127-
No
128-
</Button>
129-
</Group>
130-
</Card>
131-
)}
13291
<MessageContext
13392
key={`message-context-${index}`}
13493
contexts={contexts}

src/views/components/MessageMarkdown/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const MessageMarkdown = observer((props: MessageMarkdownProps) => {
7878
7979
Ask anything about your codebase and get answers from our AI agent.
8080
81-
DevChat intelligently navigates your codebase using GPT-4. It automatically selects and analyzes up to ten most relevant source files to answer your question, all at an approximate cost of $0.4 USD. Stay tuned — we're soon integrating the more cost-efficient LLama 2 - 70B model.
81+
DevChat intelligently navigates your codebase using GPT-4. It automatically selects and analyzes up to ten most relevant source files to answer your question. Stay tuned — we're soon integrating the more cost-efficient LLama 2 - 70B model.
8282
8383
Sample questions:
8484
- Why does the lead time for changes sometimes show as null?

src/views/stores/ChatStore.ts

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export const Message = types.model({
8080
type: types.enumeration(["user", "bot", "system"]),
8181
message: types.string,
8282
contexts: types.maybe(types.array(ChatContext)),
83-
confirm: types.maybe(types.boolean),
8483
});
8584

8685
export const ChatStore = types
@@ -214,7 +213,6 @@ DevChat key is missing from your environment or settings. Kindly input your DevC
214213
const lastUserMessage = self.messages[self.messages.length - 2];
215214
const lastBotMessage = self.messages[self.messages.length - 1];
216215
if (lastUserMessage && lastUserMessage.type === "user") {
217-
lastBotMessage.confirm = false;
218216
startGenerating(lastUserMessage.message, lastUserMessage.contexts);
219217
}
220218
self.disabled = false;
@@ -223,7 +221,6 @@ DevChat key is missing from your environment or settings. Kindly input your DevC
223221
const cancelDevchatAsk = () => {
224222
const lastBotMessage = self.messages[self.messages.length - 1];
225223
if (lastBotMessage && lastBotMessage.type === "bot") {
226-
lastBotMessage.confirm = false;
227224
lastBotMessage.message =
228225
"You've cancelled the question. Please let me know if you have any other questions or if there's anything else I can assist with.";
229226
}
@@ -281,22 +278,12 @@ Thinking...123
281278
contexts: chatContexts,
282279
message: userMessage,
283280
});
284-
const isInstalled = true;
285281

286-
if (isInstalled) {
287-
// self.disabled = true;
288-
// self.errorMessage = '';
289-
// self.messages.push({
290-
// type: 'bot',
291-
// message: '',
292-
// confirm: true
293-
// });
294-
self.messages.push({
295-
type: "bot",
296-
message: "",
297-
});
298-
startGenerating(userMessage, chatContexts);
299-
}
282+
self.messages.push({
283+
type: "bot",
284+
message: "",
285+
});
286+
startGenerating(userMessage, chatContexts);
300287

301288
// goto bottom
302289
goScrollBottom();

0 commit comments

Comments
 (0)