Skip to content

Commit fe5b720

Browse files
authored
fix: update js-chatbot to work in IDX preview (#1874)
* fix: update js-chatbot to work in IDX preview
1 parent 214dd00 commit fe5b720

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

Diff for: samples/idx-template.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"default": "js-character-generator",
1616
"options": {
1717
"js-character-generator": "Simple Character Generator",
18+
"js-chatbot": "A chatbot using Vertex and Llama 3.1 or Gemini Flash",
1819
"js-coffee-shop": "Coffeeshop w Several types of Prompt",
1920
"js-schoolAgent": "A Multi-Agent School Assistant",
2021
"js-prompts": "A sample with various prompt styles",

Diff for: samples/js-chatbot/genkit-app/angular.json

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
},
6868
"serve": {
6969
"builder": "@angular-devkit/build-angular:dev-server",
70+
"options": {
71+
"proxyConfig": "proxy.conf.json"
72+
},
7073
"configurations": {
7174
"production": {
7275
"buildTarget": "genkit-app:build:production"

Diff for: samples/js-chatbot/genkit-app/proxy.conf.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"/chatbotFlow": {
3+
"target": "http://localhost:3400/",
4+
"secure": false,
5+
"logLevel": "debug"
6+
}
7+
}

Diff for: samples/js-chatbot/genkit-app/src/app/samples/chatbot/chatbot.component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ import { MatRadioModule } from '@angular/material/radio';
3333
import { streamFlow } from 'genkit/beta/client';
3434
import { MarkdownModule } from 'ngx-markdown';
3535

36-
const url = 'http://127.0.0.1:3400/chatbotFlow';
36+
// This sample uses an angular proxy to connect to the flow
37+
// see the config in genkit-app/proxy.conf.json
38+
const url = '/chatbotFlow';
3739

3840
interface ToolResponse {
3941
name: string;

0 commit comments

Comments
 (0)