Skip to content

examples: add vision-language agent example - #298

Open
ttzc wants to merge 1 commit into
trpc-group:mainfrom
ttzc:feat/llmagent-with-vision
Open

examples: add vision-language agent example#298
ttzc wants to merge 1 commit into
trpc-group:mainfrom
ttzc:feat/llmagent-with-vision

Conversation

@ttzc

@ttzc ttzc commented Aug 14, 2026

Copy link
Copy Markdown

Summary

Add a vision-language (multimodal) agent example for LlmAgent.

  • Two-turn Q&A: turn 1 extracts key information from an image (amplitude, period, phase, etc.) without solving; turn 2 solves the problem based on the extracted context
  • Both turns share one session_id to demonstrate cross-turn context reuse
  • Model-agnostic: works with any OpenAI-compatible vision model (VLM)
  • Structure aligned with examples/llmagent (agent/config/prompts + run_agent.py + README.md), no new dependencies beyond dotenv

Fixes #296

Validation

  • Ran python run_agent.py locally: turn 1 correctly extracted amplitude, period, ω and φ without solving; turn 2 solved f(π/3) = cos(π) = -1, matching option A
  • All Python files pass py_compile
  • Copyright headers, English comments and demo messages follow repository conventions
  • New directory only; SDK code untouched (full test suite runs in CI)

Release notes

RELEASE NOTES: Added a vision-language (multimodal) example for LlmAgent.

Add a new example demonstrating multimodal messages with LlmAgent: a two-turn Q&A where the first turn extracts key information from an image and the second turn solves the problem using that context. Both turns share the same session to show cross-turn context reuse.

Fixes trpc-group#296

RELEASE NOTES: Added a vision-language (multimodal) example for LlmAgent.
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@helloopenworld

Copy link
Copy Markdown
Contributor

AI Code Review

这个 PR 增加了一个新的视觉语言示例,遵循了现有示例的既定模式。代码正确,API 引用也有效(Part/Content 是通过 google.genai.types 重新导出的,OpenAIModel 存在,Part.from_bytes 在整个代码库中均有使用)。.env 模板仅包含占位符,不包含真实凭据,符合所有其他示例的约定。我没有发现阻塞性问题。

总结

未发现明显阻塞问题。新增的 llmagent_with_vision 示例与现有示例结构一致,.env 模板仅含占位符无真实凭证,所引用的 SDK API(Part.from_bytes/Content/OpenAIModel)均存在且用法正确。

测试建议

暂无额外测试建议。示例代码不进入 CI 运行路径,依赖外部 VLM 端点,现有手工运行验证方式已足够。

@ttzc

ttzc commented Aug 14, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Rook1ex added a commit to trpc-group/cla-database that referenced this pull request Aug 14, 2026
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@1bf8510). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             main        #298   +/-   ##
==========================================
  Coverage        ?   88.50125%           
==========================================
  Files           ?         494           
  Lines           ?       47066           
  Branches        ?           0           
==========================================
  Hits            ?       41654           
  Misses          ?        5412           
  Partials        ?           0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ttzc

ttzc commented Aug 25, 2026

Copy link
Copy Markdown
Author

hi! 请问我的 PR 有没有可以改进的地方,是否有机会被 Merge. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(examples): 提议新增 LlmAgent 视觉理解(Vision)示例

2 participants