<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/firebase-ai-logic-tutorial-4---structured-json-responses-cmzlgjosv" -->

---
title: Firebase AI Logic Tutorial #4 - Structured JSON Responses
description: A hands-on walkthrough shows how to configure Firebase AI Logic to return structured JSON instead of plain text. It covers creating a response schema with the...
canonical: https://daily.dev/posts/firebase-ai-logic-tutorial-4---structured-json-responses-cmzlgjosv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Firebase AI Logic Tutorial #4 - Structured JSON Responses | daily.dev
og:description: A hands-on walkthrough shows how to configure Firebase AI Logic to return structured JSON instead of plain text. It covers creating a response schema with the...
og:url: https://daily.dev/posts/firebase-ai-logic-tutorial-4---structured-json-responses-cmzlgjosv
og:image: https://api.daily.dev/og/posts/CmZLgJoSV.png
og:image:alt: Firebase AI Logic Tutorial #4 - Structured JSON Responses
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Firebase AI Logic Tutorial #4 - Structured JSON Responses

**[Net Ninja](https://daily.dev/sources/netninja)** · 5 min read · 0 upvotes · 0 comments

## Summary

A hands-on walkthrough shows how to configure Firebase AI Logic to return structured JSON instead of plain text. It covers creating a response schema with the Firebase Schema class, defining title and content string properties, setting the response MIME type to application/json, and updating component state and templates to parse and render the individual JSON fields.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=_yJwElpTFn0>

## Questions this post answers

### How do I get Firebase AI Logic to return structured JSON instead of plain text?

Attach a responseSchema to the model's generation config using the Firebase AI Schema class, calling schema.object() with a properties object defining each field's type, such as schema.string() for a title and content property. Also set responseMimeType to application/json in the generation config, then parse the returned response text with JSON.parse before using it in your app.

_Developers wiring AI responses into app state can track integration patterns like this on daily.dev._

## Similar posts on daily.dev

- [Build intelligent Android apps: Cloud and hybrid inference](https://daily.dev/posts/build-intelligent-android-apps-cloud-and-hybrid-inference-eyctih4y9) · Android Developers Blog · 0 upvotes · 0 comments
- [Serverless AI for Android with Firebase AI Logic](https://daily.dev/posts/serverless-ai-for-android-with-firebase-ai-logic-33d7pefc4) · ProAndroidDev · 0 upvotes · 0 comments

---

Tags: [#genai](https://daily.dev/tags/genai), [#vuejs](https://daily.dev/tags/vuejs), [#firebase](https://daily.dev/tags/firebase)

[View this post on daily.dev](https://daily.dev/posts/firebase-ai-logic-tutorial-4---structured-json-responses-cmzlgjosv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Firebase AI Logic Tutorial #4 - Structured JSON Responses","url":"https://daily.dev/posts/firebase-ai-logic-tutorial-4---structured-json-responses-cmzlgjosv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/firebase-ai-logic-tutorial-4---structured-json-responses-cmzlgjosv"},"datePublished":"2026-08-25T09:00:46.467Z","dateModified":"2026-08-25T09:01:03.601Z","description":"A hands-on walkthrough shows how to configure Firebase AI Logic to return structured JSON instead of plain text. It covers creating a response schema with the...","image":"https://i.ytimg.com/vi/_yJwElpTFn0/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/_yJwElpTFn0/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Net Ninja","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Net Ninja","logo":"https://media.daily.dev/image/upload/s--IXsAE5jo--/f_auto/v1718348103/logos/netninja","url":"https://daily.dev/sources/netninja"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/firebase-ai-logic-tutorial-4---structured-json-responses-cmzlgjosv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"genai,vuejs,firebase","timeRequired":"PT5M","video":{"@type":"VideoObject","name":"Firebase AI Logic Tutorial #4 - Structured JSON Responses","description":"A hands-on walkthrough shows how to configure Firebase AI Logic to return structured JSON instead of plain text. It covers creating a response schema with the...","thumbnailUrl":"https://i.ytimg.com/vi/_yJwElpTFn0/sddefault.jpg","uploadDate":"2026-08-25T09:00:46.467Z","duration":"PT5M","url":"https://api.daily.dev/r/CmZLgJoSV","embedUrl":"https://www.youtube.com/embed/_yJwElpTFn0"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Net Ninja","item":"https://daily.dev/sources/netninja"},{"@type":"ListItem","position":3,"name":"Firebase AI Logic Tutorial #4 - Structured JSON Responses"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/firebase-ai-logic-tutorial-4---structured-json-responses-cmzlgjosv#faq","mainEntity":[{"@type":"Question","name":"How do I get Firebase AI Logic to return structured JSON instead of plain text?","acceptedAnswer":{"@type":"Answer","text":"Attach a responseSchema to the model's generation config using the Firebase AI Schema class, calling schema.object() with a properties object defining each field's type, such as schema.string() for a title and content property. Also set responseMimeType to application/json in the generation config, then parse the returned response text with JSON.parse before using it in your app. Developers wiring AI responses into app state can track integration patterns like this on daily.dev."}}]}
```

