Skip to content

Commit

Permalink
fix: types again
Browse files Browse the repository at this point in the history
  • Loading branch information
transmissions11 committed Jun 11, 2024
1 parent 06da702 commit 09f07a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import { NavigationBar } from "./utils/NavigationBar";
import { CheckCircleIcon } from "@chakra-ui/icons";
import { Box, useDisclosure, Spinner, useToast } from "@chakra-ui/react";
import mixpanel from "mixpanel-browser";
import { ChatCompletionRequestMessageInner, OpenAI } from "openai-streams";
import { OpenAI } from "openai-streams";
import { Resizable } from "re-resizable";
import { useEffect, useState, useCallback, useRef } from "react";
import { useBeforeunload } from "react-beforeunload";
Expand Down Expand Up @@ -392,7 +392,8 @@ function App() {
"No choices in response. Decoded response: " + JSON.stringify(decoded)
);

const choice: ChatCompletionRequestMessageInner = decoded.choices[0];
const choice: CreateChatCompletionStreamResponseChoicesInner =
decoded.choices[0];

if (choice.index === undefined)
throw new Error(
Expand Down Expand Up @@ -1047,9 +1048,9 @@ function App() {

<Box ml="20px">
{isAnythingLoading ? (
<Spinner size="sm" mt="6px" color={"#404040"} />
<Spinner size="sm" mt="6px" color="#404040" />
) : (
<CheckCircleIcon color={"#404040"} />
<CheckCircleIcon color="#404040" />
)}
</Box>
</Row>
Expand Down
6 changes: 3 additions & 3 deletions src/utils/prompt.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { FluxNodeData, FluxNodeType, Settings } from "./types";
import { CreateCompletionRequest } from "openai-streams";
import { ChatCompletionRequestMessage } from "openai";
import { MAX_AUTOLABEL_CHARS } from "./constants";
import { Node } from "reactflow";

export function messagesFromLineage(
lineage: Node<FluxNodeData>[],
settings: Settings
): CreateCompletionRequest[] {
const messages: CreateCompletionRequest[] = [];
): ChatCompletionRequestMessage[] {
const messages: ChatCompletionRequestMessage[] = [];

// Iterate backwards.
for (let i = lineage.length - 1; i >= 0; i--) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Node, Edge } from "reactflow";

import { ChatCompletionResponseMessage } from "openai-streams";
import { ChatCompletionResponseMessage } from "openai";

export type FluxNodeData = {
label: string;
Expand Down

0 comments on commit 09f07a7

Please sign in to comment.