Skip to content

Commit

Permalink
tweak examples
Browse files Browse the repository at this point in the history
  • Loading branch information
yuiseki committed Jan 7, 2024
1 parent ad92ea8 commit edeb1f1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"Izakaya",
"Jajarkot",
"jsonv",
"Juárez",
"Karnali",
"Kita",
"Kurunegala",
Expand Down
33 changes: 27 additions & 6 deletions src/utils/langchain/chains/deep/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,37 @@ export const tridentDeepExampleList: Array<{
{
input: "Area: Sudan",
output: `[out:json][timeout:30000];
relation["boundary"="administrative"]["name"="Sudan"];
relation["boundary"="administrative"]["admin_level"=2]["name"="Sudan"];
out geom;`,
},
{
input: "Area: Lebanon",
output: `[out:json][timeout:30000];
relation["boundary"="administrative"]["name"="Lebanon"];
relation["boundary"="administrative"]["admin_level"=2]["name"="Lebanon"];
out geom;`,
},
{
input: "Area: Kosovo",
output: `[out:json][timeout:30000];
relation["boundary"="administrative"]["admin_level"=2]["name"="Kosovo"];
out geom;`,
},
{
input: "Area: Nepal",
output: `[out:json][timeout:30000];
relation["boundary"="administrative"]["admin_level"=2]["name"="Nepal"];
out geom;`,
},
{
input: "Area: New York City",
output: `[out:json][timeout:30000];
relation["boundary"="administrative"]["name"="City of New York"];
relation["boundary"="administrative"]["admin_level"=5]["name"="City of New York"];
out geom;`,
},
{
input: "Area: Tokyo",
output: `[out:json][timeout:30000];
relation["boundary"="administrative"]["name"="Tokyo"];
relation["boundary"="administrative"]["admin_level"=4]["name"="Tokyo"];
out geom;`,
},
{
Expand Down Expand Up @@ -95,7 +107,16 @@ out geom;`,
area["name:en"="Nepal"]->.outer;
area["name:en"="Karnali Province"]->.inner;
(
relation["boundary"="administrative"]["name:en"="Western Rukum District"](area.inner)(area.outer);
relation["boundary"="administrative"]["name"="Western Rukum District"](area.inner)(area.outer);
);
out geom;`,
},
{
input: "Nepal, UNICEF facilities",
output: `[out:json][timeout:30000];
area["name"="Nepal"]->.searchArea;
(
nwr["name"~"UNICEF"](area.searchArea);
);
out geom;`,
},
Expand Down Expand Up @@ -371,7 +392,7 @@ export const loadTridentDeepPrompt = async (embeddings: Embeddings) => {
const memoryVectorStore = new MemoryVectorStore(embeddings);
const exampleSelector = new SemanticSimilarityExampleSelector({
vectorStore: memoryVectorStore,
k: 3,
k: 5,
inputKeys: ["input"],
});
const examplePrompt = PromptTemplate.fromTemplate(
Expand Down
9 changes: 9 additions & 0 deletions src/utils/langchain/chains/inner/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ ColorForConcern: Embassies, lightblue
AreaWithConcern: Lebanon, Military facilities
EmojiForConcern: Military facilities, 🪖
ColorForConcern: Military facilities, yellow`,
},
{
input: "コソボの大使館を表示して",
output: `ConfirmHelpful: 地図の作成が完了しました。他にご要望はありますか?私たちは皆さんのお役に立つことができましたでしょうか?
TitleOfMap: コソボの大使館
Area: Kosovo
AreaWithConcern: Kosovo, Embassies
EmojiForConcern: Embassies, 🏢
ColorForConcern: Embassies, lightblue`,
},
{
input: `ネパールのユニセフの施設の地図を表示します。`,
Expand Down

1 comment on commit edeb1f1

@vercel
Copy link

@vercel vercel bot commented on edeb1f1 Jan 7, 2024

Choose a reason for hiding this comment

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

Please sign in to comment.