mirror of
https://github.com/wavetermdev/waveterm
synced 2026-04-21 14:37:16 +00:00
- [x] Create new directory pkg/aiusechat/google - [x] Implement SummarizeFile function with: - Context parameter for timeout - File validation (images, PDFs, text files only) - Use gemini-2.5-flash-lite model - Configurable API URL and prompt as constants - Return (string, usage, error) - [x] Define Google-specific usage struct - [x] Test the implementation (all tests pass) - [x] Verify with existing linting and build - [x] Run CodeQL security check (no issues found) - [x] Revert unintended tsunami demo dependency changes ## Summary Successfully implemented a new Google AI package at `pkg/aiusechat/google` with: 1. **SummarizeFile function** - A simple request-response API (not streaming, not SSE) - Takes context for timeout - Validates file types (images, PDFs, text only) - Enforces file size limits matching wshcmd-ai.go - Uses gemini-2.5-flash-lite model - Returns (summary string, usage stats, error) 2. **GoogleUsage struct** - Tracks token consumption: - PromptTokenCount - CachedContentTokenCount - CandidatesTokenCount - TotalTokenCount 3. **Configurable constants**: - GoogleAPIURL (for reference) - SummarizePrompt (customizable prompt) - SummarizeModel (gemini-2.5-flash-lite) 4. **Comprehensive tests** - 41.7% coverage with all tests passing 5. **Security verified** - No CodeQL alerts 6. **Package documentation** - doc.go with usage examples Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| aiusechat | ||
| authkey | ||
| blockcontroller | ||
| blocklogger | ||
| docsite | ||
| eventbus | ||
| faviconcache | ||
| filestore | ||
| genconn | ||
| gogen | ||
| ijson | ||
| panichandler | ||
| remote | ||
| schema | ||
| service | ||
| shellexec | ||
| suggestion | ||
| telemetry | ||
| trimquotes | ||
| tsgen | ||
| userinput | ||
| util | ||
| utilds | ||
| vdom | ||
| waveai | ||
| waveapp | ||
| wavebase | ||
| waveobj | ||
| wcloud | ||
| wconfig | ||
| wcore | ||
| web | ||
| wps | ||
| wshrpc | ||
| wshutil | ||
| wsl | ||
| wslconn | ||
| wstore | ||