Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/ai/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function App() {
onPress={async () => {
const app = getApp();
const ai = getAI(app);
const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' });
const model = getGenerativeModel(ai, { model: 'gemini-2.5-flash' });

const result = await model.generateContent('What is 2 + 2?');

Expand Down Expand Up @@ -75,7 +75,7 @@ function App() {
onPress={async () => {
const app = getApp();
const ai = getAI(app);
const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' });
const model = getGenerativeModel(ai, { model: 'gemini-2.5-flash' });

const result = await model.generateContentStream('Write a short poem');

Expand Down Expand Up @@ -111,7 +111,7 @@ function App() {
onPress={async () => {
const app = getApp();
const ai = getAI(app);
const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' });
const model = getGenerativeModel(ai, { model: 'gemini-2.5-flash' });
const prompt = 'What can you see?';
const base64Emoji =
'iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3/OAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANCSURBVEiJtZZPbBtFFMZ/M7ubXdtdb1xSFyeilBapySVU8h8OoFaooFSqiihIVIpQBKci6KEg9Q6H9kovIHoCIVQJJCKE1ENFjnAgcaSGC6rEnxBwA04Tx43t2FnvDAfjkNibxgHxnWb2e/u992bee7tCa00YFsffekFY+nUzFtjW0LrvjRXrCDIAaPLlW0nHL0SsZtVoaF98mLrx3pdhOqLtYPHChahZcYYO7KvPFxvRl5XPp1sN3adWiD1ZAqD6XYK1b/dvE5IWryTt2udLFedwc1+9kLp+vbbpoDh+6TklxBeAi9TL0taeWpdmZzQDry0AcO+jQ12RyohqqoYoo8RDwJrU+qXkjWtfi8Xxt58BdQuwQs9qC/afLwCw8tnQbqYAPsgxE1S6F3EAIXux2oQFKm0ihMsOF71dHYx+f3NND68ghCu1YIoePPQN1pGRABkJ6Bus96CutRZMydTl+TvuiRW1m3n0eDl0vRPcEysqdXn+jsQPsrHMquGeXEaY4Yk4wxWcY5V/9scqOMOVUFthatyTy8QyqwZ+kDURKoMWxNKr2EeqVKcTNOajqKoBgOE28U4tdQl5p5bwCw7BWquaZSzAPlwjlithJtp3pTImSqQRrb2Z8PHGigD4RZuNX6JYj6wj7O4TFLbCO/Mn/m8R+h6rYSUb3ekokRY6f/YukArN979jcW+V/S8g0eT/N3VN3kTqWbQ428m9/8k0P/1aIhF36PccEl6EhOcAUCrXKZXXWS3XKd2vc/TRBG9O5ELC17MmWubD2nKhUKZa26Ba2+D3P+4/MNCFwg59oWVeYhkzgN/JDR8deKBoD7Y+ljEjGZ0sosXVTvbc6RHirr2reNy1OXd6pJsQ+gqjk8VWFYmHrwBzW/n+uMPFiRwHB2I7ih8ciHFxIkd/3Omk5tCDV1t+2nNu5sxxpDFNx+huNhVT3/zMDz8usXC3ddaHBj1GHj/As08fwTS7Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=';
Expand Down Expand Up @@ -168,7 +168,7 @@ function App() {
},
});
const model = getGenerativeModel(ai, {
model: 'gemini-1.5-flash',
model: 'gemini-2.5-flash',
generationConfig: {
responseMimeType: 'application/json',
responseSchema: jsonSchema,
Expand Down Expand Up @@ -204,7 +204,7 @@ function App() {
onPress={async () => {
const app = getApp();
const ai = getAI(app);
const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' });
const model = getGenerativeModel(ai, { model: 'gemini-2.5-flash' });

const chat = model.startChat({
history: [
Expand Down Expand Up @@ -307,7 +307,7 @@ function App() {
const app = getApp();
const ai = getAI(app);
const model = getGenerativeModel(ai, {
model: 'gemini-1.5-flash',
model: 'gemini-2.5-flash',
tools: fetchWeatherTool,
});

Expand Down Expand Up @@ -366,7 +366,7 @@ function App() {
onPress={async () => {
const app = getApp();
const ai = getAI(app);
const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' });
const model = getGenerativeModel(ai, { model: 'gemini-2.5-flash' });
// Count tokens & billable character for text input
const { totalTokens, totalBillableCharacters } = await model.countTokens(
'Write a story about a magic backpack.',
Expand Down Expand Up @@ -461,7 +461,7 @@ function App() {
};

const ai = getAI(app, options);
const model = getGenerativeModel(ai, { model: 'gemini-1.5-flash' });
const model = getGenerativeModel(ai, { model: 'gemini-2.5-flash' });

const result = await model.generateContent('What is 2 + 2?');

Expand Down
Loading