Skip to content

Commit

Permalink
feat: Add start_open prop to ChatWidget component
Browse files Browse the repository at this point in the history
  • Loading branch information
anovazzi1 committed Aug 14, 2024
1 parent dd8fb5c commit 971f3d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chatWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function ChatWidget({
input_container_style,
additional_headers,
session_id,
start_open=false,
}: {
api_key?: string;
input_value: string,
Expand Down Expand Up @@ -61,8 +62,9 @@ export default function ChatWidget({
tweaks?: { [key: string]: any };
additional_headers?: { [key: string]: string };
session_id?: string;
start_open?: boolean;
}) {
const [open, setOpen] = useState(false);
const [open, setOpen] = useState(start_open);
const [messages, setMessages] = useState<ChatMessageType[]>([]);
const sessionId = useRef(session_id ?? uuidv4());
function updateLastMessage(message: ChatMessageType) {
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ChatWidget from './chatWidget';
customElements.define('langflow-chat', r2wc(ChatWidget, {
shadow: "closed",
props: {
start_open: "boolean",
api_key: "string",
output_type: "string",
input_type: "string",
Expand Down

0 comments on commit 971f3d8

Please sign in to comment.