-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[docs]: copying threads #1350
[docs]: copying threads #1350
Conversation
}' | ||
``` | ||
|
||
### Thread creation |
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.
Don't think we need this section at all, we can just add a note to the section below saying "This assumes that a thread you'd like to copy already exists"
original_thread_history = list(map(remove_thread_id,await client.threads.get_history(<THREAD_ID>))) | ||
copied_thread_history = list(map(remove_thread_id,await client.threads.get_history(copied_thread['thread_id']))) | ||
|
||
if original_thread_history == copied_thread_history: |
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.
(nit) maybe just do assert original == copied? hopefully we will never see "histories are different" :)
const copiedThreadHistory = (await client.threads.getHistory(copiedThreadId)).map(removeThreadId); | ||
|
||
// Compare the two histories | ||
if (JSON.stringify(originalThreadHistory) === JSON.stringify(copiedThreadHistory)) { |
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.
same -- maybe just console.assert?
@@ -0,0 +1,165 @@ | |||
# Copying Threads | |||
|
|||
You may wish to copy an existing thread in order to keep the existing history and experiment with different runs in the future. |
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.
Maybe something like "You may wish to copy (i.e. "fork") an existing thread in order to keep the existing thread's history and create independent runs that do not affect the original thread. This guide shows how you can do that."
|
||
## Setup | ||
|
||
To copy a thread, we must first set up our client and also create a thread we wish to copy. |
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.
don't think we need to actually create one, we can just say "we assume you already have a thread to copy. if not, see this guide on how to make one"
No description provided.