Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.0.23 #66

Merged
merged 3 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ and more...
- [x] OpenAI
- [x] Anthropic
- [x] Google chat-bison-001
- [x] fireworks.ai's llama 2 models api

open source chatmodels soon...

### Embedding models

Expand Down
2 changes: 1 addition & 1 deletion app/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "app",
"private": true,
"version": "0.0.22",
"version": "0.0.23",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
32 changes: 31 additions & 1 deletion app/ui/src/components/Bot/Playground/Message.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
import {
CheckIcon,
ClipboardIcon,
} from "@heroicons/react/24/outline";
import { Message } from "../../../store";
import Markdown from "./Markdown";
import Markdown from "../../Common/Markdown";
import React from "react";

export const PlaygroundMessage = (props: Message) => {
const [isBtnPressed, setIsBtnPressed] = React.useState(false);

React.useEffect(() => {
if (isBtnPressed) {
setTimeout(() => {
setIsBtnPressed(false);
}, 4000);
}
}, [isBtnPressed]);

return (
<div
className={`group w-full text-gray-800 dark:text-gray-100 border-b border-black/10 dark:border-gray-900/50 ${
Expand Down Expand Up @@ -32,6 +47,21 @@ export const PlaygroundMessage = (props: Message) => {
</div>
</div>
</div>
{props.isBot && (
<button
onClick={() => {
navigator.clipboard.writeText(props.message);
setIsBtnPressed(true);
}}
className="flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
>
{!isBtnPressed ? (
<ClipboardIcon className="w-4 h-4 text-gray-400 group-hover:text-gray-500" />
) : (
<CheckIcon className="w-4 h-4 text-green-400 group-hover:text-green-500" />
)}
</button>
)}
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Markdown({ message }: { message: string }) {
PreTag="div"
/>
) : (
<code className={className} {...props}>
<code className={`${className} bg-gray-200 rounded-md p-1 text-sm`} {...props}>
{children}
</code>
);
Expand All @@ -30,7 +30,7 @@ export default function Markdown({ message }: { message: string }) {
<a
target="_blank"
rel="noreferrer"
className="text-blue-500 hover:underline"
className="text-blue-500 text-sm hover:underline"
{...props}
>
{props.children}
Expand All @@ -39,21 +39,24 @@ export default function Markdown({ message }: { message: string }) {
},
li({ node, ...props }) {
return (
<li className="list-decimal marker:text-gray-500" {...props}>
<li
className="list-decimal text-sm marker:text-gray-500"
{...props}
>
{props.children}
</li>
);
},
ul({ node, ...props }) {
return (
<ul className="mx-2" {...props}>
<ul className="mx-2 text-sm" {...props}>
{props.children}
</ul>
);
},
ol({ node, ...props }) {
return (
<ul className="mx-2" {...props}>
<ul className="mx-2 text-sm" {...props}>
{props.children}
</ul>
);
Expand Down Expand Up @@ -107,9 +110,64 @@ export default function Markdown({ message }: { message: string }) {
</p>
);
},
table({ node, ...props }) {
return (
<table
className="border-collapse border text-sm border-gray-300"
{...props}
>
{props.children}
</table>
);
},
thead({ node, ...props }) {
return (
<thead className="bg-gray-100" {...props}>
{props.children}
</thead>
);
},
tbody({ node, ...props }) {
return (
<tbody className="divide-y divide-gray-300" {...props}>
{props.children}
</tbody>
);
},
tr({ node, ...props }) {
return (
<tr className="divide-x divide-gray-300" {...props}>
{props.children}
</tr>
);
},

th({ node, ...props }) {
return (
<th className="p-2" {...props}>
{props.children}
</th>
);
},

td({ node, ...props }) {
return (
<td className="p-2" {...props}>
{props.children}
</td>
);
},

blockquote({ node, ...props }) {
return (
<blockquote className="border-l-4 border-gray-300 pl-2" {...props}>
{props.children}
</blockquote>
);
},
}}
>
{message}
</ReactMarkdown>
);
}
}
27 changes: 26 additions & 1 deletion app/ui/src/utils/chatModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,28 @@ export const availableChatModels = [
{ value: "claude-instant-1", label: "Claude Instant (Anthropic)" },
{
value: "google-bison",
label: "Google chat-bison-001 (beta)",
label: "Google chat-bison-001",
},
{
value: "llama-v2-7b-chat",
label: "Llama v2 7B (Fireworks)",
},
{
value: "llama-v2-13b-chat",
label: "Llama v2 13B (Fireworks)",
},
{
value: "llama-v2-70b-chat",
label: "Llama v2 70B (Fireworks)",
},
{
value: "llama-v2-7b-chat-w8a16",
label: "Llama v2 7B Chat int8 (Fireworks)",
},
{
value: "llama-v2-13b-chat-w8a16",
label: "Llama v2 13B Chat int8 (Fireworks)",
}
// {
// value: "falcon-7b-instruct-inference",
// label: "Falcon 7B Instruct (HuggingFace Inference API)",
Expand All @@ -24,6 +44,11 @@ export const streamingSupportedModels = [
"claude-1",
"claude-instant-1",
"claude-2",
"llama-v2-7b-chat",
"llama-v2-13b-chat",
"llama-v2-70b-chat",
"llama-v2-7b-chat-w8a16",
"llama-v2-13b-chat-w8a16",
];

export const isStreamingSupported = (model: string) => {
Expand Down
11 changes: 11 additions & 0 deletions docs/guide/why-dialoqbase.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ Here is a list of chat models that are currently supported by dialoqbase:

* chat-bison-001


### Llama via Fireworks.ai

* llama v2 7b

* llama v2 13b

* llama v2 70b

Note: In order to use Llama models you need to provide [fireworks.ai](https://fireworks.ai/) API key. You can get a free API key from [here](https://fireworks.ai/).

### Embedding Models

Here is a list of embedding models that are currently supported by dialoqbase:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dialoqbase",
"version": "0.0.22",
"version": "0.0.23",
"description": "Create chatbots with ease",
"scripts": {
"ui:dev": "pnpm run --filter ui dev",
Expand Down
6 changes: 3 additions & 3 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
},
"scripts": {
"test": "npm run build:ts && tsc -p test/tsconfig.json && tap --ts \"test/**/*.test.ts\"",
"start:test": "npm run build:ts && fastify start -l info dist/app.js",
"start": "npx prisma migrate deploy && fastify start -l info app.js",
"start:test": "npm run build:ts && fastify start dist/app.js",
"start": "npx prisma migrate deploy && fastify start app.js",
"build:ts": "tsc && copyfiles -u 1 \"src/**/*.js \" dist",
"build": "tsc && copyfiles -u 1 \"src/**/*.js \" dist",
"db": "prisma generate",
"watch:ts": "tsc -w",
"dev": "npm run build:ts && concurrently -k -p \"[{name}]\" -n \"TypeScript,App\" -c \"yellow.bold,cyan.bold\" \"npm:watch:ts\" \"npm:dev:start\"",
"dev:start": "fastify start --ignore-watch=uploads,.ts$ -w -l info -P dist/app.js"
"dev:start": "fastify start --ignore-watch=uploads,.ts$ -w -P dist/app.js"
},
"keywords": [],
"author": "",
Expand Down
Loading