mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-16 06:28:08 +01:00
ui enhancements, model tuning
This commit is contained in:
@@ -19,6 +19,7 @@ export default function ChatWindow({ conversation, loading, onConfirm }) {
|
||||
}
|
||||
|
||||
const filtered = conversation.filter((msg) => {
|
||||
console.log(conversation[conversation.length - 1].actor)
|
||||
const { actor, response } = msg;
|
||||
|
||||
if (actor === "user") {
|
||||
@@ -61,6 +62,11 @@ export default function ChatWindow({ conversation, loading, onConfirm }) {
|
||||
<LoadingIndicator />
|
||||
</div>
|
||||
)}
|
||||
{conversation.length > 0 && conversation[conversation.length - 1].actor === "tool_result_to_llm" && (
|
||||
<div className="flex justify-center">
|
||||
<LoadingIndicator />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import LoadingIndicator from "./LoadingIndicator";
|
||||
export default function ConfirmInline({ data, confirmed, onConfirm }) {
|
||||
const { args, tool } = data || {};
|
||||
|
||||
console.log("ConfirmInline rendered with confirmed:", confirmed);
|
||||
|
||||
if (confirmed) {
|
||||
// Once confirmed, show "Running..." state in the same container
|
||||
return (
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
|
||||
export default function LoadingIndicator() {
|
||||
return (
|
||||
<div className="flex items-center justify-center space-x-2">
|
||||
<div className="flex items-center justify-center space-x-2 pb-4">
|
||||
<div className="w-2 h-2 rounded-full bg-blue-600 animate-ping"></div>
|
||||
<div className="w-2 h-2 rounded-full bg-blue-600 animate-ping delay-100"></div>
|
||||
<div className="w-2 h-2 rounded-full bg-blue-600 animate-ping delay-200"></div>
|
||||
|
||||
@@ -60,7 +60,7 @@ export default function App() {
|
||||
try {
|
||||
await fetch("http://127.0.0.1:8000/end-chat", { method: "POST" });
|
||||
// sleep for a bit to allow the server to process the end-chat request
|
||||
await new Promise((resolve) => setTimeout(resolve, 4000)); // todo make less dodgy
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000)); // todo make less dodgy
|
||||
await fetch(
|
||||
`http://127.0.0.1:8000/send-prompt?prompt=${encodeURIComponent("I'd like to travel to an event.")}`,
|
||||
{ method: "POST" }
|
||||
@@ -71,6 +71,12 @@ export default function App() {
|
||||
}
|
||||
};
|
||||
|
||||
const handleKeyPress = (e) => {
|
||||
if (e.key === "Enter") {
|
||||
handleSendMessage();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex flex-col min-h-screen">
|
||||
<NavBar title="Temporal AI Agent" />
|
||||
@@ -91,6 +97,7 @@ export default function App() {
|
||||
placeholder="Type your message..."
|
||||
value={userInput}
|
||||
onChange={(e) => setUserInput(e.target.value)}
|
||||
onKeyPress={handleKeyPress}
|
||||
/>
|
||||
<button
|
||||
onClick={handleSendMessage}
|
||||
|
||||
Reference in New Issue
Block a user