Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
28ecb65
Updates example code for Next.js in docs (#857)
philnash Sep 17, 2024
8865e7d
fix(js): disabled explicit json mode when using tools (#888)
cabljac Sep 17, 2024
8611c7e
Add usage and safety score logs for output candidates (#919)
schnecle Sep 17, 2024
0e8d9b8
fix: correctly pass local auth context when doing runFlow (#920)
pavelgj Sep 17, 2024
2940fd5
Update the flow name extraction regex to support the scenario where t…
bryanatkinson Sep 18, 2024
09014eb
Truncate logs based on utf bytes instead of characters. There's no gu…
bryanatkinson Sep 19, 2024
75a16af
feat(js/plugins/vertexai): strict json mode (#890)
cabljac Sep 23, 2024
50cfbe8
fix(docs): replace obsolete package name (#943)
DenisVCode Sep 23, 2024
486dc9d
fix model name lookup in dotprompt plugin and add a test (#933)
Sep 24, 2024
1f3ca67
chore: update express to 4.21.0 (#956)
tonybaroneee Sep 25, 2024
49c0352
docs(js): update token fetching in ollama docs (#918)
cabljac Sep 26, 2024
4510fff
feat(js): add llama-3.2 support to model garden plugin (#969)
huangjeff5 Sep 26, 2024
03943bc
chore: bump @genkit-ai/tools-common version to @genkit-ai/tools-commo…
gh-action-bump-version Sep 27, 2024
ef93f3f
chore: bump CLI version to genkit@0.5.14
gh-action-bump-version Sep 27, 2024
a15c96b
chore: bump @genkit-ai/core version to @genkit-ai/core@0.5.14
gh-action-bump-version Sep 27, 2024
8ac0750
chore: bump @genkit-ai/ai version to @genkit-ai/ai@0.5.14
gh-action-bump-version Sep 27, 2024
650f3ca
chore: bump @genkit-ai/flow version to @genkit-ai/flow@0.5.14
gh-action-bump-version Sep 27, 2024
696266d
chore: bump genkitx-chromadb version to genkitx-chromadb0.5.14
gh-action-bump-version Sep 27, 2024
69454e2
chore: bump @genkit-ai/dev-local-vectorstore version to @genkit-ai/de…
gh-action-bump-version Sep 27, 2024
e3276c4
chore: bump @genkit-ai/dotprompt version to @genkit-ai/dotprompt@0.5.14
gh-action-bump-version Sep 27, 2024
d60c0ee
chore: bump @genkit-ai/evaluator version to @genkit-ai/evaluator@0.5.14
gh-action-bump-version Sep 27, 2024
87153d8
chore: bump @genkit-ai/firebase version to @genkit-ai/firebase@0.5.14
gh-action-bump-version Sep 27, 2024
56ea3d4
chore: bump @genkit-ai/google-cloud version to @genkit-ai/google-clou…
gh-action-bump-version Sep 27, 2024
5578c15
chore: bump @genkit-ai/googleai version to @genkit-ai/googleai@0.5.14
gh-action-bump-version Sep 27, 2024
8bb2556
chore: bump genkitx-langchain version to genkitx-langchain@0.5.14
gh-action-bump-version Sep 27, 2024
eea8945
chore: bump genkitx-ollama version to genkitx-ollama@0.5.14
gh-action-bump-version Sep 27, 2024
e78ee12
chore: bump genkitx-pinecone version to genkitx-pinecone@0.5.14
gh-action-bump-version Sep 27, 2024
81e4b13
chore: bump @genkit-ai/vertexai version to @genkit-ai/vertexai@0.5.14
gh-action-bump-version Sep 27, 2024
9513f6d
chore: s/GenKit/Genkit/ 🤦
pavelgj Sep 28, 2024
42da470
Set min version for cloud-trace-exporter to 2.4.1 (#984)
MichaelDoyle Oct 1, 2024
1ce4f38
chore: update to pnpm v9.11 (#940) (#941)
tonybaroneee Oct 1, 2024
5ba4bfe
feat: Adds text-embedding-004 to GoogleAI embeddings.
philnash Oct 3, 2024
b4e313a
Exports textEmbedding004 from googleai. Documents textEmbedding004
philnash Oct 3, 2024
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
2 changes: 1 addition & 1 deletion docs/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ want to enable TTL for the trace documents:
https://firebase.google.com/docs/firestore/ttl

```ts
import { firebase } from '@genkit-ai/plugin-firebase';
import { firebase } from '@genkit-ai/firebase';

configureGenkit({
plugins: [firebase()],
Expand Down
10 changes: 6 additions & 4 deletions docs/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,23 @@ Node.js 20 or later.
import { useState } from 'react';

export default function Home() {
const [menuItem, setMenu] = useState<string>('');
const [menuItem, setMenuItem] = useState<string>('');

async function getMenuItem(formData: FormData) {
const theme = formData.get('theme')?.toString() ?? '';
const suggestion = await callMenuSuggestionFlow(theme);
setMenu(suggestion);
setMenuItem(suggestion);
}

return (
<main>
<form action={getMenuItem}>
<label>
<label htmlFor="theme">
Suggest a menu item for a restaurant with this theme:{' '}
</label>
<input type="text" name="theme" />
<input type="text" name="theme" id="theme" />
<br />
<br />
<button type="submit">Generate</button>
</form>
<br />
Expand Down
5 changes: 3 additions & 2 deletions docs/plugins/google-genai.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import {
gemini15Flash,
gemini15Pro,
textEmbeddingGecko001,
textEmbedding004,
} from '@genkit-ai/googleai';
```

Expand All @@ -77,11 +78,11 @@ const llmResponse = await generate({
});
```

or use embedders (ex. `textEmbeddingGecko001`) with `embed` or retrievers:
or use embedders (ex. `textEmbedding004`) with `embed` or retrievers:

```js
const embedding = await embed({
embedder: textEmbeddingGecko001,
embedder: textEmbedding004,
content: input,
});
```
Expand Down
34 changes: 22 additions & 12 deletions docs/plugins/ollama.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,39 +66,49 @@ import { GoogleAuth } from 'google-auth-library';
import { ollama, OllamaPluginParams } from 'genkitx-ollama';
import { configureGenkit, isDevEnv } from '@genkit-ai/core';

const ollamaCommon = {models: [{name: "gemma:2b"}]};
const ollamaCommon = { models: [{ name: 'gemma:2b' }] };

const ollamaDev = {
...ollamaCommon,
serverAddress: 'http://127.0.0.1:11434',
} as OllamaPluginParams;

const ollamaProd = {
...ollamaCommon,
serverAddress: 'https://my-deployment',
requestHeaders: async (params) => ({
Authorization: `Bearer ${await getIdToken(params.serverAddress)}`,
}),
requestHeaders: async (params) => {
const headers = await fetchWithAuthHeader(params.serverAddress);
return { Authorization: headers['Authorization'] };
},
} as OllamaPluginParams;

export default configureGenkit({
plugins: [
ollama(isDevEnv() ? ollamaDev: ollamaProd),
ollama(isDevEnv() ? ollamaDev : ollamaProd),
],
});

export async function getIdToken(url: string): Promise<string> {
const auth = getAuthClient();
const client = await auth.getIdTokenClient(url);
return client.idTokenProvider.fetchIdToken(url);
}

// Function to lazily load GoogleAuth client
let auth: GoogleAuth;
function getAuthClient() {
// Lazy load GoogleAuth client.
if (!auth) {
auth = new GoogleAuth();
}
return auth;
}

// Function to fetch headers, reusing tokens when possible
async function fetchWithAuthHeader(url: string) {
const client = await getIdTokenClient(url);
const headers = await client.getRequestHeaders(url); // Auto-manages token refresh
return headers;
}

async function getIdTokenClient(url: string) {
const auth = getAuthClient();
const client = await auth.getIdTokenClient(url);
return client;
}
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions genkit-tools/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "genkit",
"version": "0.5.13",
"description": "CLI for interacting with the Google GenKit AI framework",
"version": "0.5.14",
"description": "CLI for interacting with the Google Genkit AI framework",
"license": "Apache-2.0",
"keywords": [
"genkit",
Expand Down
4 changes: 2 additions & 2 deletions genkit-tools/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@genkit-ai/tools-common",
"version": "0.5.13",
"version": "0.5.14",
"scripts": {
"compile": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json",
"build:clean": "rm -rf ./lib",
Expand All @@ -18,7 +18,7 @@
"colorette": "^2.0.20",
"commander": "^11.1.0",
"configstore": "^5.0.1",
"express": "^4.18.2",
"express": "^4.21.0",
"get-port": "5.1.1",
"glob": "^10.3.12",
"inquirer": "^8.2.0",
Expand Down
2 changes: 1 addition & 1 deletion genkit-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"zod": "^3.22.4",
"zod-to-json-schema": "^3.22.4"
},
"packageManager": "pnpm@9.10.0+sha256.355a8ab8dbb6ad41befbef39bc4fd6b5df85e12761d2724bd01f13e878de4b13"
"packageManager": "pnpm@9.11.0+sha256.1c0e33f70e5df9eede84a357bdfa0b1f9dba6e58194628d48a1055756f553754"
}
Loading