-
Notifications
You must be signed in to change notification settings - Fork 166
Feat/google docs plan step v0 [INTEG-3341] #10360
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
base: master
Are you sure you want to change the base?
Conversation
* wip * simplify agent * organize oauth functions * reorganizing function handlers * reorganizing function handlers (prev `createEntriesfromDocument`) calling each agent in a separate function, + removing plan agent for now * fix: function manifest * minor edit to manifest * replacing single function with 2: one for analyzing ct + one for document processing * fix: add oauth token to analyze content type function * fix: adding entries to document processor o/p * feat: new app action to create entries, preview modal * cleanup + rename preview function * cleanup * chore: delete test docs * cleanup * rename handler for consistency
* feat: got google doc picker working * feat: explicitly add api key for google docs oauth connection
apps/google-docs/functions/agents/documentParserAgent/documentParser.agent.ts
Outdated
Show resolved
Hide resolved
| const analyzeContentTypesResponse = await analyzeContentTypesAction( | ||
| sdk, | ||
| contentTypeIds, | ||
| oauthToken | ||
| ); | ||
| console.log('analyzeContentTypesResponse', analyzeContentTypesResponse); | ||
| // If entries provided, use them directly. Otherwise fetch document JSON as fallback | ||
| let documentJson: unknown | undefined; | ||
| if (!entries || entries.length === 0) { | ||
| documentJson = await fetchGoogleDocAsJson(documentId, oauthToken); | ||
| } | ||
|
|
||
| const processDocumentResponse = await createPreviewAction( | ||
| const response = await createEntriesFromDocumentAction( | ||
| sdk, | ||
| contentTypeIds, | ||
| documentId, | ||
| oauthToken | ||
| ); | ||
| console.log('processDocumentResponse', processDocumentResponse); | ||
| entries, | ||
| documentJson | ||
| ) as any; | ||
| const result: FinalEntriesResult = response.sys.result; |
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.
should we revert to using two functions instead of one?
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.
i'm not sure I understand, aren't we using two functions?
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.
I looked into it and the createPreview function only calls the document parser agent and not the content type parser agent (this agent was called by the analyzeContentTypes function that was deleted in the manifest) Was that intentional? If so we would need to delete the content type parser agent.
apps/google-docs/functions/agents/documentParserAgent/documentParser.agent.ts
Outdated
Show resolved
Hide resolved
apps/google-docs/functions/handlers/createPreview/createPreviewHandler.ts
Outdated
Show resolved
Hide resolved
apps/google-docs/functions/handlers/createPreview/createPreviewHandler.ts
Outdated
Show resolved
Hide resolved
apps/google-docs/functions/handlers/createPreview/createPreviewHandler.ts
Outdated
Show resolved
Hide resolved
|
|
||
| const submit = useCallback( | ||
| async (contentTypeIds: string[]) => { | ||
| async (contentTypeIds: string[], entries?: any[]) => { |
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.
Why do we have a diff here? Isn't this part for the content type analysis, but now we are fetching the docs and calling create entries? I think this is not what this hook is intended for
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.
no?
| }, [isSubmitting, modalStates.isLoadingModalOpen, closeModal, clearPlan]); | ||
|
|
||
| // Handle plan generation completion | ||
| useEffect(() => { |
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.
where did this come from
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.
we need this to get the modals to switch when the preview is generated
bf31297 to
6c505b7
Compare
Purpose
The preview step was the final missing piece of the flow
Things introduced in this PR:
Approach
Testing steps
Breaking Changes
Dependencies and/or References
Deployment