Skip to content

Conversation

BrandonStudio
Copy link
Contributor

@BrandonStudio BrandonStudio commented Nov 12, 2024

๐Ÿ’ป ๅ˜ๆ›ด็ฑปๅž‹ | Change Type

  • โœจ feat
  • ๐Ÿ› fix
  • โ™ป๏ธ refactor
  • ๐Ÿ’„ style
  • ๐Ÿ‘ท build
  • โšก๏ธ perf
  • ๐Ÿ“ docs
  • ๐Ÿ”จ chore

๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change

Complement Cloudflare provider:

  • Support function calling
  • Add Image-to-Text models*
  • Complement tests

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

Won't do in this PR:

  • Embeddings
  • Text-to-Image
  • Text-to-Speech

NOTES:

  • To improve function calling performance, system prompt of plugins is disabled within Cloudflare.
  • Requests with tools get non-stream response.

* The Image-to-Text models are incapable of multi-round dialogue; they don't even support multiple images. See (resource) ai > (method) run > (params) 0 > (param) body > (schema) > (variant) 12 > (property) image.

Former #3402

Copy link

vercel bot commented Nov 12, 2024

@BrandonStudio is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

๐Ÿ‘ @BrandonStudio

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆๅ‡บๆ‹‰ๅ–่ฏทๆฑ‚ๅนถไธบๆˆ‘ไปฌ็š„็คพๅŒบๅšๅ‡บ่ดก็Œฎ๏ผŒ่ฏท็กฎไฟๆ‚จๅทฒ็ป้ตๅพชไบ†ๆˆ‘ไปฌ็š„่ดก็ŒฎๆŒ‡ๅ—๏ผŒๆˆ‘ไปฌไผšๅฐฝๅฟซๅฎกๆŸฅๅฎƒใ€‚
ๅฆ‚ๆžœๆ‚จ้‡ๅˆฐไปปไฝ•้—ฎ้ข˜๏ผŒ่ฏท้šๆ—ถไธŽๆˆ‘ไปฌ่”็ณปใ€‚

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests โœ…

Project coverage is 92.56%. Comparing base (49e1e08) to head (40b8f0f).
Report is 278 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4671      +/-   ##
==========================================
+ Coverage   92.53%   92.56%   +0.03%     
==========================================
  Files         522      522              
  Lines       37335    37462     +127     
  Branches     2351     3539    +1188     
==========================================
+ Hits        34547    34676     +129     
+ Misses       2788     2786       -2     
Flag Coverage ฮ”
app 92.56% <100.00%> (+0.03%) โฌ†๏ธ
server 97.26% <รธ> (รธ)

Flags with carried forward coverage won't be shown. Click here to find out more.

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

@BrandonStudio BrandonStudio marked this pull request as ready for review November 12, 2024 07:33
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. ๐ŸŒ  Feature Request New feature or request | ็‰นๆ€งไธŽๅปบ่ฎฎ labels Nov 12, 2024
@BrandonStudio BrandonStudio changed the title Support Cloudflare function calling โœจ feat: Support Cloudflare function calling Nov 19, 2024
@BrandonStudio BrandonStudio marked this pull request as draft December 19, 2024 08:52
@BrandonStudio BrandonStudio marked this pull request as ready for review March 27, 2025 01:43
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Mar 27, 2025
Copy link
Contributor

gru-agent bot commented Mar 27, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 40b9ae6 ๐Ÿšซ Skipped No files need to be tested {"package.json":"target file(package.json) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/ \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,/*.spec.js,src/database/server","src/config/modelProviders/cloudflare.ts":"target file(src/config/modelProviders/cloudflare.ts) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/** \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,/*.spec.js,src/database/server","src/libs/agent-runtime/cloudflare/index.test.ts":"target file(src/libs/agent-runtime/cloudflare/index.test.ts) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/** \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,**/*.spec.js,src/database/servโ€ฆ

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@BrandonStudio
Copy link
Contributor Author

There has been a major refactor of LLM providers since this draft, so it may need a new clean branch to make the Pull Request clearer. But perhaps I would just merge the latest commits into the current branch.

There are some code that might be unnecessary or outdated.

Comment on lines +120 to +128
if (error instanceof ToolPropertyError) {
throw AgentRuntimeError.chat({
endpoint: desensitizedEndpoint,
error: error,
errorType: AgentRuntimeErrorType.PluginNotSupportError,
provider: ModelProvider.Cloudflare,
});
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arvinxx I would like to know what you think about this new defined error

@BrandonStudio
Copy link
Contributor Author

BrandonStudio commented Mar 27, 2025

Text-to-Image models support will not be included in this PR, as they are incapable of multi-round dialogue; they don't even support multiple images. See (resource) ai > (method) run > (params) 0 > (param) body > (schema) > (variant) 12 > (property) image.

@BrandonStudio
Copy link
Contributor Author

Cloudflare applied a patch to Workers AI to support streamed tool calling. This PR needs to be reconsidered.
I'm probably going to start a brand new Pull Request with latest changes. This PR is now converted to draft again.

@BrandonStudio BrandonStudio marked this pull request as draft April 17, 2025 03:57
@arvinxx arvinxx changed the base branch from main-archived to main September 2, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐ŸŒ  Feature Request New feature or request | ็‰นๆ€งไธŽๅปบ่ฎฎ size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants