Skip to content

AI Agents #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 26, 2025
Merged

AI Agents #307

merged 8 commits into from
Mar 26, 2025

Conversation

pinkeshmars
Copy link
Collaborator

Description

AI Agents

Linear ticket and magic word Fixes DEVR-807

Type of change

  • Typo fix
  • New feature
  • Enhancement to current docs
  • Removed outdated references
  • Update assets

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions bot requested a review from PoojaB26 March 21, 2025 12:01
Here, you specify the type of inputs users can send to the AI.

- **Text**: Allows users to send text-based messages.
- **Image**: Enables image input, allowing the AI to analyze photos.
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that for the Google agent, we also accept Audio and Video.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added.

Copy link
Contributor

@MaggieThomann MaggieThomann left a comment

Choose a reason for hiding this comment

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

Looks great, a few minor comments but nothing too crazy


- **Text**: Returns plain text responses.
- **Markdown**: Allows richer formatting (headings, lists, links) if you display content as markdown. For example, An FAQ chatbot that uses formatted bullet points, and bold or italic text to highlight key info.
- **Data Type (JSON)**: Returns structured data, which can be parsed programmatically. For example, a restaurant finder app might need structured data, e.g., `{ name: 'Pizza Palace', distance: '2.4 miles' }` to display a dynamic map.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just refer to this as JSON for now? Technically it's just a JSON object. Later, we will add a 4th option (Data Type) and the JSON will be automatically parsed into the data type. But for now, it's just JSON.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

Here, you can fine-tune how the agent generates responses.

- **Temperature**: Controls how creative or random the AI’s responses can be on a scale of 0 to 1. A lower value (e.g., 0.1) makes responses more factual and consistent. A higher value (e.g., 1.0) makes responses more creative and varied (e.g., brainstorming ideas).
- **Max Tokens**: Sets the response length limit—helpful for cost control or for ensuring short, direct replies.
Copy link
Contributor

Choose a reason for hiding this comment

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

I learned recently that the max tokens includes both the user's request AND the response. So maybe specify that here. I updated the tooltip in the product to: This is the maximum combined length of the request and response in tokens.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!


:::info

After you successfully deploy the agent, any changes made to its configuration—such as modifying the system message, model, or temperature will require you to redeploy the Agent.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe mention here that deploying and re-deploys are only necessary for non Google agents. For Google agents, the configuration of the agent is stored client side, so we dont need to redeploy anything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

- **Select Agent**: Here, you select the specific AI Agent you previously configured.
- **Conversation ID**: The Conversation ID is a unique identifier you assign to maintain context and continuity across multiple interactions within the same conversation. Using a consistent ID (e.g., `user123_AIStylist_202503181200`) allows the AI to remember past interactions and keep conversations coherent and contextual.
- **Text Input**: This is where you specify the user's message or input text that the AI agent will process. Typically, this input comes from a widget state (e.g., TextField).
- **Image Input**: If your agent supports image processing, you can provide an image either from [local device](../../ff-concepts/file-handling/displaying-media.md#uploaded-file) storage or a [network URL](../../ff-concepts/file-handling/displaying-media.md#network).
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, it's tricky -- for non-Google agents, we only allow network URLs. If we allowed uploaded files, we'd have to pass base64 data to the cloud function and I found that they ran out of memory. The workaround for non-Google agents is that users can simply have users choose a local image, upload it to a bucket, and then pass the URL of that bucket.

But for Google agents, we allow both uploaded image data and network URLs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure, updated!


## Clear Chat History [Action]

The **Clear Chat History** action allows you to clear the remembered context. It takes the **Conversation ID** and stops referencing the existing thread ID when you next send a message. For example, you can add this action on the refresh button inside the chat to manually reset a conversation and start a fresh one with a new context.
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect explanation. That's all they need to know.

@@ -2,8 +2,8 @@
slug: /integrations/gemini
title: Gemini
Copy link
Contributor

Choose a reason for hiding this comment

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

We are going to deprecate the Gemini action eventually. Maybe can you add some sort of callout here redirecting users to use the new AI Agent instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added!

@@ -191,7 +191,8 @@ Once the library is imported, following resources are accessible for use:
- [Assets](../../resources/projects/settings/general-settings.md#app-assets) (Note: These are not versioned)

:::note
Pages and Firestore Collections are still being worked on and may come in future updates.
- Pages and Firestore Collections are still being worked on and may come in future updates.
- Creation of [**AI Agents**](../../ff-integrations/AI/ai-agents.md) is not yet supported in the Library project
Copy link
Contributor

Choose a reason for hiding this comment

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

Another note is that cloud functions are also not available in Library projects. I learned that recently :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

pinkeshmars and others added 2 commits March 24, 2025 12:45
Co-authored-by: Maggie McRoskey <mmthomann@gmail.com>
@pinkeshmars
Copy link
Collaborator Author

Hi @MaggieThomann all the review comments are addressed now! :)

@PoojaB26
Copy link
Collaborator

@pinkeshmars please rename the folder AI to "ai" to follow the naming convention.

#### Model Settings

- **Provider**: Allows you to select the AI vendor for this agent. Currently, we support **OpenAI**, **Google,** and **Anthropic**.
- **OpenAI & Anthropic**: If you choose OpenAI or Anthropic, FlutterFlow will create a [Cloud Function](https://firebase.google.com/docs/functions) in Firebase to relay requests to the AI API securely. Hence, your Firebase project must be on a [Blaze](https://firebase.google.com/pricing) plan (paid) to deploy the necessary cloud function.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add that for OpenAI and Anthropic, the deployed cloud function will only be accessible if the user calling it is authenticated? We do this in other cloud functions we deploy for the user too (like the Stripe payment one). Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, added!

@pinkeshmars pinkeshmars merged commit 1ff69b8 into main Mar 26, 2025
1 check passed
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.

3 participants