Refactor provider generate functions to return GenerateResult
Consolidate cross-cutting concerns (token logging, JSON validation) into
the wrapper functions in think/models.py. Provider functions now return
a structured GenerateResult dict instead of plain strings.
Changes:
- Rename generate/agenerate to run_generate/run_agenerate in all providers
- Add GenerateResult TypedDict with text, usage, finish_reason, thinking
- Move token logging from providers to wrapper
- Move JSON validation (IncompleteJSONError) from providers to wrapper
- Normalize finish_reason to standard values in each provider
- Update docs/PROVIDERS.md and docs/THINK.md to reflect new API
- Fix Google empty text handling to return friendly completion message
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>