How ttkindboy/gdocs-ai-fancifier works
Main Components
a) Client-Side Components:
• Google Docs Interface
• Google Apps Script Runtime
• Document Processing Module
• OpenAI Integration Module
b) External Services:
• OpenAI API Service
Component Relationships
1. User → Google Docs UI
2. Google Docs UI → Code.gs (main function)
3. Code.gs → Document Processing (readDocument, processText, replaceText)
4. openai.gs → OpenAI API
Specific Implementation Details
[Google Docs UI] → [Code.gs (main)]
• ↓
[Document Processing]
• ↓ readDocument()
• ↓ processText()
• ↓ replaceText()
• ↓
[OpenAI Integration]
• ↓ callOpenAI()
• ↓
[OpenAI API]
Technical Details
Notes for:
• API endpoint (/v1/chat/completions)
• Model used (gpt-3.5-turbo)
• Authentication method (Bearer token)
• Response handling