-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from concord-consortium/188650126-non-develope…
…r-model-training feat: user can select assistant id when in dev mode (PT-188650126)
- Loading branch information
Showing
24 changed files
with
277 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
context("Test the overall app", () => { | ||
it("renders without crashing", () => { | ||
cy.visit("/"); | ||
cy.get("body").should("contain", "Loading..."); | ||
cy.get("body").should("contain", "DAVAI"); | ||
cy.get("[data-testid=chat-transcript]").should("exist"); | ||
cy.get("[data-testid=chat-input]").should("exist"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { createContext } from "react"; | ||
import { AppConfigModelType } from "./models/app-config-model"; | ||
import { AppConfigModelType } from "../models/app-config-model"; | ||
|
||
export const AppConfigContext = createContext<AppConfigModelType | undefined>(undefined); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { createContext } from "react"; | ||
import { OpenAI } from "openai"; | ||
|
||
export const createNewConnection = () => { | ||
return new OpenAI({ | ||
apiKey: process.env.REACT_APP_OPENAI_API_KEY || "fake-key", | ||
baseURL: process.env.REACT_APP_OPENAI_BASE_URL, | ||
dangerouslyAllowBrowser: true, | ||
organization: "org-jbU1egKECzYlQI73HMMi7EOZ", | ||
project: "proj_VsykADfoZHvqcOJUHyVAYoDG", | ||
}); | ||
}; | ||
|
||
export const OpenAIConnectionContext = createContext<OpenAI|undefined>(undefined); | ||
|
||
export const OpenAIConnectionProvider = ({ children }: {children: React.ReactNode}) => { | ||
const apiConnection = createNewConnection(); | ||
return ( | ||
<OpenAIConnectionContext.Provider value={apiConnection}> | ||
{children} | ||
</OpenAIConnectionContext.Provider> | ||
); | ||
}; |
Oops, something went wrong.