Skip to content

[Firebase AI] Add typed structured output generation method#15740

Draft
andrewheard wants to merge 44 commits intomainfrom
ai-structured-output
Draft

[Firebase AI] Add typed structured output generation method#15740
andrewheard wants to merge 44 commits intomainfrom
ai-structured-output

Conversation

@andrewheard
Copy link
Contributor

WIP - Added support for generating Swift types with a new generate<Content>(_ type: Content.Type, from parts: any [PartsRepresentable]) method.

Example Usage
let prompt = "What is -14C in Fahrenheit?"
let model = FirebaseAI.firebaseAI().generativeModel(modelName: "gemini-2.5-flash")

// Generate a Float value
let response = try await model.generate(Float.self, from: prompt)
print(response.content) // 6.8

#no-changelog

@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@danger-firebase-ios
Copy link

1 Warning
⚠️ New public headers were added, did you remember to add them to the umbrella header?

Generated by 🚫 Danger

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants