-
Notifications
You must be signed in to change notification settings - Fork 5
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
File Citation for File Search (Retrieval) #160
Comments
|
File citations found during "thread.message.delta" event in event stream (with streaming). Example:
Currently, Assuming streaming is implemented, these object can be accessed via: <script>
...
async function responseInterceptor(response) {
if (response.object === "thread.message.delta") {
const newContent = response.delta.content.map((content) => {
const newContents = content.map((msg) => {
if (msg.type !== "text") {
return msg;
}
msg.annotations.forEach((annotation) => {
if (annotation.type === "file_citation") {
const quote = `Quote:\n"${annotation.file_citation.quote}"`;
msg.text.replace(annotation.text, quote);
}
});
return msg;
});
return newContents;
});
response.delta.content = newContent;
}
return response;
}
...
</script> This would also need to be implemented in thread loading via: async function convertThreadMessagesToMessages(threadId, threadMessages) { ... } In both cases, likely best to add something like a Not entirely sure what the best form of replacement is for these citations. Could do something like the inline quote, cite them as they are with quotes at the bottom, proper citations (MLA, APA, etc. like you mentioned) inline or at the bottom, or something else entirely if you had any ideas. |
enclose within a bibtex citation syntax ‘\cite{filename.pdf}’ or ‘\cite{filename}’ at the end of every sentence with a ‘source’ mark and at the end a bibtex entry with the document data keys and the quote as bibtex comment within |
i managed to do that in openai assistant playground by:
The text was updated successfully, but these errors were encountered: