Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeesha committed Dec 29, 2024
1 parent 0987e52 commit 2785c45
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 254 deletions.
9 changes: 4 additions & 5 deletions sdk-react/demo/TestPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ import { useRun } from "../src";
import { useAgent } from "../src/hooks/useAgent";

export function TestPage(props: {}) {
const runConfig = useRun({
const run = useRun({
clusterId: "01J7M4V93BBZP3YJYSKPDEGZ2T",
baseUrl: "https://api.inferable.ai",
authType: "custom",
customAuthToken: "test",
});

const { Trigger, Pane } = useAgent({
initialMessage: "System Status",
run: runConfig,
userInputs: ["Times to ping"],
prompt: "Ping the server, and return the system status at the time of the ping.",
run,
});

return (
<div>
<Trigger>Get the system status</Trigger>
<Trigger>Check system</Trigger>
<Pane floating />
</div>
);
Expand Down
111 changes: 5 additions & 106 deletions sdk-react/src/hooks/useAgent.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,92 +51,6 @@
background-color: #e4e4e7;
}

.agent-form {
display: flex;
flex-direction: column;
gap: 0.75rem;
font-family: var(--font-sans);
width: 90%;
padding: 0.5rem;
flex-shrink: 0;
}

.agent-form-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}

.agent-label {
font-size: 0.75rem;
font-weight: 500;
letter-spacing: -0.011em;
color: var(--color-text-secondary);
}

.agent-form .agent-input {
padding: 0.375rem 0.75rem;
font-size: 0.75rem;
border-radius: 0.375rem;
}

.agent-form .agent-button {
align-self: flex-start;
padding: 0.375rem 0.75rem;
font-size: 0.75rem;
border-radius: 0.375rem;
}

.agent-input {
width: 100%;
padding: 0.5rem 0.75rem;
font-family: var(--font-sans);
font-size: 0.875rem;
letter-spacing: -0.011em;
color: var(--color-text-primary);
border: 1px solid var(--color-border);
border-radius: 0.375rem;
background: var(--color-background);
transition: all 0.2s ease;
}

.agent-input:focus {
outline: none;
border-color: var(--color-text-tertiary);
box-shadow: 0 0 0 0.125rem rgba(24, 24, 27, 0.05);
}

.agent-input::placeholder {
color: #9ca3af;
}

.agent-button {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.5rem 1rem;
font-family: var(--font-sans);
font-size: 0.875rem;
font-weight: 500;
letter-spacing: -0.011em;
color: var(--color-background);
background-color: var(--color-primary);
border-radius: 0.375rem;
border: 1px solid var(--color-primary);
cursor: pointer;
transition: all 0.2s ease;
}

.agent-button:hover {
background-color: var(--color-primary-hover);
border-color: var(--color-primary-hover);
}

.agent-button:focus {
outline: none;
box-shadow: 0 0 0 0.125rem rgba(24, 24, 27, 0.05);
}

.agent-pane {
position: fixed;
top: 0;
Expand All @@ -159,7 +73,6 @@
bottom: auto;
right: auto;
height: 31.25rem;
border-radius: 0.5rem;
overflow: hidden;
}

Expand All @@ -169,7 +82,6 @@
flex-direction: column;
background: transparent;
backdrop-filter: blur(10px);
border-radius: 0.5rem;
border: 1px solid var(--color-border);
overflow: hidden;
position: relative;
Expand All @@ -188,10 +100,9 @@
display: flex;
justify-content: flex-start;
background: transparent;
position: sticky;
bottom: 0;
width: 100%;
margin-top: 1rem;
margin-top: 0;
flex-shrink: 0;
}

.agent-message-composer form {
Expand Down Expand Up @@ -229,7 +140,6 @@
display: flex;
align-items: center;
gap: 0.5rem;
width: calc(100% - 4rem);
}

.agent-message-input {
Expand Down Expand Up @@ -283,10 +193,9 @@
}

.agent-status {
font-size: 0.7rem;
color: var(--color-text-tertiary);
margin-top: 0.5rem;
margin-left: 0.25rem;
color: var(--color-text-secondary);
margin: 0;
font-size: 0.75rem;
}

.agent-bottom-bar {
Expand All @@ -305,13 +214,3 @@
z-index: 10;
flex-shrink: 0;
}

.agent-status {
color: var(--color-text-secondary);
margin: 0;
}

.agent-message-composer {
margin-top: 0;
flex-shrink: 0;
}
Loading

0 comments on commit 2785c45

Please sign in to comment.