Skip to content

Commit 00a7f24

Browse files
committed
use policyai
1 parent 52d39f3 commit 00a7f24

File tree

10 files changed

+52
-7
lines changed

10 files changed

+52
-7
lines changed

client/agents/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ <h1 class="h3 mb-3 text-primary">Agents</h1>
2727

2828
<div class="row">
2929
<div class="col-md-3">
30-
<a href="./agents/compliai" class="card cursor-pointer shadow-hover mb-4 text-decoration-none" style="border-left: 4px solid steelblue">
30+
<a href="./agents/policyai" class="card cursor-pointer shadow-hover mb-4 text-decoration-none" style="border-left: 4px solid steelblue">
3131
<div class="card-body">
3232
<div class="card-title">
33-
<h2 class="h6 text-center text-primary">CompliAI</h2>
33+
<h2 class="h6 text-center text-primary">PolicyAI</h2>
3434
</div>
3535
<div class="card-text text-center fw-normal">
3636
<div class="small text-muted">AI Policy Research and Compliance</div>
File renamed without changes.
File renamed without changes.

client/agents/compliai/index.html client/agents/policyai/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div class="bg-primary-dark text-light">
3939
<div class="container py-1">
4040
<a href="../" class="link-light fs-5">Research Optimizer</a>
41-
<span class="text-light fs-5 ms-1"> / CompliAI</span>
41+
<span class="text-light fs-5 ms-1"> / PolicyAI</span>
4242
</div>
4343
</div>
4444
</header>
@@ -147,6 +147,6 @@
147147
</div>
148148
</footer>
149149

150-
<script type="module" src="agents/compliai/index.js"></script>
150+
<script type="module" src="agents/policyai/index.js"></script>
151151

152152
</html>

client/agents/compliai/index.js client/agents/policyai/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function Page() {
3232
return html`
3333
<div class="flex-grow-1">
3434
<div class="text-center my-5" hidden=${() => messages().length > 0}>
35-
<h1 class="display-6">Welcome to CompliAI</h1>
35+
<h1 class="display-6">Welcome to PolicyAI</h1>
3636
<p class="fw-light fs-5">To get started, send a message below.</p>
3737
</div>
3838
${() => messages().map((message) => html`<${Message} message=${message} />`)}
File renamed without changes.
File renamed without changes.

client/components/chat.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import html from "solid-js/html";
2+
3+
4+
export async function chat(endpoint, model, messages, systemPrompt) {
5+
const response = await fetch(endpoint, {
6+
method: 'POST',
7+
headers: {
8+
'Content-Type': 'application/json'
9+
},
10+
body: JSON.stringify({ model, messages, systemPrompt })
11+
});
12+
if (!response.ok) {
13+
throw new Error(response.statusText);
14+
}
15+
for await(const chunk of response.body) {
16+
console.log(chunk);
17+
}
18+
}
19+
20+
21+
export default function Chat({ messages = [], endpoint = './api/model/stream', systemPrompt = 'You are a helpful assistant' }) {
22+
return html`<div>
23+
<div>
24+
${messages.map((message) => html`<div>${message}</div>`)}
25+
</div>
26+
<div>
27+
<input type="text" placeholder="Type a message..." />
28+
<button>Send</button>
29+
</div>
30+
</div>`;
31+
}

client/components/nav.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import html from "solid-js/html";
2+
import { A } from "@solidjs/router";
3+
4+
export default function Nav({ routes }) {
5+
return html`<nav>
6+
<ul>
7+
${routes.map(
8+
(route) => html`<li>
9+
<${A} href=${route.path} end=${!route.path || route.path === "/"} activeClass="active"> ${route.title} </>
10+
</li>`
11+
)}
12+
</ul>
13+
</nav>`;
14+
}

client/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ <h5 class="card-title mb-3 text-primary">Workspaces</h5>
8484
</a>
8585
</div>
8686
<div class="col-md">
87-
<a class="card mb-4 h-100 border-0 shadow-hover text-decoration-none" href="/agents/compliai">
87+
<a class="card mb-4 h-100 border-0 shadow-hover text-decoration-none" href="/agents/policyai">
8888
<div class="card-body text-center">
8989
<svg xmlns="http://www.w3.org/2000/svg" class="mt-2 mb-4" height="60" fill="#0d2648" viewBox="0 0 640 512">
9090
<path
@@ -95,7 +95,7 @@ <h5 class="card-title mb-3 text-primary">Workspaces</h5>
9595
class="text-primary"
9696
d="M134.7 124c0-25.8 20.9-46.7 46.7-46.7l47.4 0c29.1 0 52.6 23.6 52.6 52.6c0 18.8-10.1 36.3-26.4 45.6L228 191l0 6.3 0 20-40 0 0-20 0-17.9 0-11.6 10-5.8L235 140.9c3.9-2.3 6.3-6.4 6.3-10.9c0-7-5.7-12.6-12.6-12.6l-47.4 0c-3.7 0-6.7 3-6.7 6.7l0 5.5-40 0 0-5.5zM188 250.7l40 0 0 40-40 0 0-40zM432 512c-95.6 0-176.2-54.6-200.5-129C348.9 372.9 448 288.3 448 176c0-5.2-.2-10.4-.6-15.5C555.1 167.1 640 243.2 640 336c0 37.5-13.9 72.3-37.6 100.9L640 512 531.9 490.4C502.3 504.2 468.2 512 432 512zM566.1 318.1L580.3 304 552 275.7l-14.1 14.1L472 355.7l-25.9-25.9L432 315.7 403.7 344l14.1 14.1 40 40L472 412.3l14.1-14.1 80-80z" />
9797
</svg>
98-
<h5 class="card-title mb-3 text-primary">CompliAI</h5>
98+
<h5 class="card-title mb-3 text-primary">PolicyAI</h5>
9999
<p class="card-text fw-normal">
100100
Access real-time guidance on federal policies.
101101
</p>

0 commit comments

Comments
 (0)