llm_tool_firebase_ai 0.3.0
llm_tool_firebase_ai: ^0.3.0 copied to clipboard
Use llm_tool with Firebase AI Logic (firebase_ai). Turns your @LlmTool functions into Gemini function declarations and runs the whole tool loop.
0.3.0 #
- Renamed from
llm_tool_calling_firebase_ai(now discontinued), to go with the core package's new name,llm_tool. Importpackage:llm_tool_firebase_ai/llm_tool_firebase_ai.dart. toFirebaseAITool()replacestoFirebaseAiTool()(Dart style for two-letter acronyms); the old name is deprecated until 1.0.0. The extensions are nowToolDefinitionFirebaseAIandToolListFirebaseAI.- The re-export of
llm_tool_callingleaves out the annotations (LlmTool,Paramand the deprecatedTool). - Requires
llm_tool_calling0.7.0.
0.2.0 #
- Uses
ToolDefinition.invokefromllm_tool_calling0.6.0, so tools behave the same with every SDK.ToolConfirmationnow comes fromllm_tool_calling(still available through this package). - If a tool throws during firebase_ai's automatic function calling, Gemini
now gets a clear
error. - Requires
llm_tool_calling0.6.0.
0.1.1 #
- Works with
llm_tool_calling0.5.x (and still 0.3.x and 0.4.x). - Clearer package description: the adapter runs the whole tool loop.
0.1.0 #
- Initial release.
chat.sendMessageWithTools(message, allTools)runs the whole tool loop. Tested live withgemini-3.8-flash.toolResponses(results)sends tool results with the roleuser, because newer Gemini models reject thefunctionrole that firebase_ai'sContent.functionResponsesuses.allTools.toFirebaseAiTool()for firebase_ai's own automatic function calling (fails with newer models until firebase_ai releases flutterfire#18685; see the README).toFunctionDeclarations()andrespondTo(functionCall)for manual function calling.- Arguments are validated before anything runs; errors go back to Gemini.
- Tools with
requiresConfirmationonly run when aconfirmcallback approves them. - Tools with duplicate names are refused with an
ArgumentError, instead of firebase_ai silently keeping only one. - Re-exports
ToolDefinition,ToolArgumentExceptionand the other runtime types, so a model-setup file only needs firebase_ai and this package. toFirebaseJsonSchema()converts llm_tool_calling JSON schemas to firebase_aiJSONSchema, sent asparametersJsonSchema.