-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix(ci): update supabase and OpenAI version #4213
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3d1baac
fix(ci): update supabase version
krisantrobus 9791387
fix(ci): debug actions
krisantrobus b2738b0
fix(ci): debug actions
krisantrobus e6c518b
fix(ci): update gen schema
krisantrobus 2cc145c
chore(ci): remove debug step
krisantrobus f9c5f35
chore(ci): update OpenAI version
krisantrobus 55870d7
fix(docs): change assitant types from new package
krisantrobus 4dcb281
fix(docs): change assitant types from new package
krisantrobus 2fb4864
fix(docs): change assitant types from new package
krisantrobus 2d89d14
fix(docs-ai): create thread on submit
krisantrobus 5cdf3c6
fix(docs-ai): create thread on submit
krisantrobus 8e50a08
fix(docs-ai): use latest model
krisantrobus 5434def
chore(ci): cleanup
krisantrobus 346f93b
chore(icons-docs): add icon docs
krisantrobus 032f8d2
chore(icons-docs): rever add icon docs
krisantrobus b4c0ec5
fix(ci): sitemap
krisantrobus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -9,6 +9,6 @@ | |
"db:reset": "yarn supabase db reset" | ||
}, | ||
"devDependencies": { | ||
"supabase": "^1.204.3" | ||
"supabase": "^2.6.8" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
apps/backend/supabase/migrations/20230928013336_initial_schema.sql
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,5 +1,5 @@ | ||
/* eslint-disable camelcase */ | ||
import type { ThreadMessage } from "openai/resources/beta/threads/messages/messages"; | ||
import type { Message } from "openai/resources/beta/threads/messages"; | ||
import * as React from "react"; | ||
|
||
import { | ||
|
@@ -19,14 +19,14 @@ import { AsssistantLayout } from "./AssistantLayout"; | |
import { AssistantThreads } from "./AssistantThreads"; | ||
import { AssistantHeader } from "./AsststantHeader"; | ||
|
||
const getMockMessage = ({ message }: { message: string }): ThreadMessage => { | ||
const getMockMessage = ({ message, threadId }: { message: string; threadId: string }): Message => { | ||
const date = new Date(); | ||
|
||
return { | ||
id: "", | ||
object: "thread.message", | ||
created_at: Math.floor(date.getTime() / 1000), | ||
thread_id: "xxxx", | ||
thread_id: threadId, | ||
role: "user", | ||
content: [ | ||
{ | ||
|
@@ -37,10 +37,14 @@ const getMockMessage = ({ message }: { message: string }): ThreadMessage => { | |
}, | ||
}, | ||
], | ||
file_ids: [], | ||
assistant_id: null, | ||
run_id: null, | ||
metadata: {}, | ||
attachments: null, | ||
completed_at: null, | ||
incomplete_at: null, | ||
incomplete_details: null, | ||
status: "incomplete", | ||
}; | ||
}; | ||
|
||
|
@@ -58,7 +62,7 @@ export const Assistant: React.FC = () => { | |
|
||
const handleMessageCreation = (message: string, threadId: string): void => { | ||
// add the new user message to the store to optimistically render it whilst we wait for openAI to do its thing | ||
addMessage(getMockMessage({ message })); | ||
addMessage(getMockMessage({ message, threadId })); | ||
|
||
// Create a new "assistant run" on the thread so that openAI processes the new message and updates the thread with a response | ||
createAssistantRun.mutate( | ||
|
@@ -105,7 +109,7 @@ export const Assistant: React.FC = () => { | |
* | ||
* @param {string} message | ||
*/ | ||
const handleCannedThreadCreation = (message: string): void => { | ||
const handleThreadCreationWithMessage = (message: string): void => { | ||
createThreadMutation.mutate( | ||
{}, | ||
{ | ||
|
@@ -130,11 +134,19 @@ export const Assistant: React.FC = () => { | |
</AsssistantLayout.Threads> | ||
<AsssistantLayout.Canvas> | ||
{threadsStore.selectedThreadID == null && ( | ||
<AssistantEmptyState onCannedThreadCreation={handleCannedThreadCreation} /> | ||
<AssistantEmptyState onCannedThreadCreation={handleThreadCreationWithMessage} /> | ||
)} | ||
{threadsStore.selectedThreadID != null && <AssistantCanvas selectedThreadID={threadsStore.selectedThreadID} />} | ||
<AsssistantLayout.Composer> | ||
<AssistantComposer onMessageCreation={handleMessageCreation} /> | ||
<AssistantComposer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ohh nice 👏 |
||
onMessageCreation={(message, threadId) => { | ||
if (!threadId) { | ||
handleThreadCreationWithMessage(message); | ||
} else { | ||
handleMessageCreation(message, threadId); | ||
} | ||
}} | ||
/> | ||
</AsssistantLayout.Composer> | ||
</AsssistantLayout.Canvas> | ||
</AsssistantLayout.Window> | ||
|
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
4 changes: 2 additions & 2 deletions
4
packages/paste-website/src/components/assistant/AssistantMessage.tsx
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
4 changes: 2 additions & 2 deletions
4
packages/paste-website/src/components/assistant/UserMessage.tsx
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 |
---|---|---|
|
@@ -29,7 +29,7 @@ const LOG_PREFIX = "[/api/paste-assistant-message]:"; | |
async function createUserMessage({ | ||
threadId, | ||
message, | ||
}: { threadId: string; message: string }): Promise<OpenAI.Beta.Threads.Messages.ThreadMessage> { | ||
}: { threadId: string; message: string }): Promise<OpenAI.Beta.Threads.Messages.Message> { | ||
return openai.beta.threads.messages.create(threadId, { role: "user", content: message }); | ||
} | ||
|
||
|
@@ -182,7 +182,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) | |
/** | ||
* perform run on the assistant to process the newly added user message | ||
*/ | ||
let run = await openai.beta.threads.runs.create(threadId, { assistant_id: assistantID }); | ||
let run = await openai.beta.threads.runs.create(threadId, { assistant_id: assistantID, model: "gpt-4o" }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the model, should have performance improvements |
||
|
||
/** | ||
* poll the run to see if it's complete or if the assistant need to call some "Functions" find it's status | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will default to the pgvector of the DB used by the environment