Skip to content

Commit

Permalink
Move processRequests function to 'typechat/interactive' package (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg authored Mar 20, 2024
1 parent f193e63 commit 6a15d78
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 11 deletions.
3 changes: 2 additions & 1 deletion typescript/examples/calendar/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import dotenv from "dotenv";
import findConfig from "find-config";
import fs from "fs";
import path from "path";
import { createJsonTranslator, createLanguageModel, processRequests } from "typechat";
import { createJsonTranslator, createLanguageModel } from "typechat";
import { createTypeScriptJsonValidator } from "typechat/ts";
import { processRequests } from "typechat/interactive";
import { CalendarActions } from './calendarActionsSchema';

const dotEnvPath = findConfig(".env");
Expand Down
3 changes: 2 additions & 1 deletion typescript/examples/coffeeShop-zod/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import assert from "assert";
import dotenv from "dotenv";
import findConfig from "find-config";
import { createJsonTranslator, createLanguageModel, processRequests } from "typechat";
import { createJsonTranslator, createLanguageModel } from "typechat";
import { createZodJsonValidator } from "typechat/zod";
import { processRequests } from "typechat/interactive";
import { z } from "zod";
import { CoffeeShopSchema } from "./coffeeShopSchema";

Expand Down
3 changes: 2 additions & 1 deletion typescript/examples/coffeeShop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import dotenv from "dotenv";
import findConfig from "find-config";
import fs from "fs";
import path from "path";
import { createJsonTranslator, createLanguageModel, processRequests } from "typechat";
import { createJsonTranslator, createLanguageModel } from "typechat";
import { createTypeScriptJsonValidator } from "typechat/ts";
import { processRequests } from "typechat/interactive";
import { Cart } from "./coffeeShopSchema";

const dotEnvPath = findConfig(".env");
Expand Down
3 changes: 2 additions & 1 deletion typescript/examples/healthData/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import dotenv from "dotenv";
import findConfig from "find-config";
import fs from "fs";
import path from "path";
import { createLanguageModel, processRequests } from "typechat";
import { createLanguageModel } from "typechat";
import { processRequests } from "typechat/interactive";
import { HealthDataResponse } from "./healthDataSchema";
import { createHealthDataTranslator } from "./translator";

Expand Down
3 changes: 2 additions & 1 deletion typescript/examples/math/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import dotenv from "dotenv";
import findConfig from "find-config";
import fs from "fs";
import path from "path";
import { createLanguageModel, getData, processRequests } from "typechat";
import { createLanguageModel, getData } from "typechat";
import { processRequests } from "typechat/interactive";
import { createModuleTextFromProgram, createProgramTranslator, evaluateJsonProgram } from "typechat/ts";

const dotEnvPath = findConfig(".env");
Expand Down
3 changes: 2 additions & 1 deletion typescript/examples/multiSchema/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import dotenv from "dotenv";
import findConfig from "find-config";
import fs from "fs";
import path from "path";
import { createLanguageModel, processRequests } from "typechat";
import { createLanguageModel } from "typechat";
import { processRequests } from "typechat/interactive";
import { createJsonMathAgent, createJsonPrintAgent } from "./agent";
import { createAgentRouter } from "./router";

Expand Down
4 changes: 3 additions & 1 deletion typescript/examples/restaurant/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import path from "path";
import {
createJsonTranslator,
createLanguageModel,
processRequests,
} from "typechat";
import {
processRequests,
} from "typechat/interactive";
import {
createTypeScriptJsonValidator,
} from "typechat/ts";
Expand Down
3 changes: 2 additions & 1 deletion typescript/examples/sentiment-zod/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import assert from "assert";
import dotenv from "dotenv";
import findConfig from "find-config";
import { createJsonTranslator, createLanguageModel, processRequests } from "typechat";
import { createJsonTranslator, createLanguageModel } from "typechat";
import { processRequests } from "typechat/interactive";
import { createZodJsonValidator } from "typechat/zod";
import { SentimentSchema } from "./sentimentSchema";

Expand Down
3 changes: 2 additions & 1 deletion typescript/examples/sentiment/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import dotenv from "dotenv";
import findConfig from "find-config";
import fs from "fs";
import path from "path";
import { createJsonTranslator, createLanguageModel, processRequests } from "typechat";
import { createJsonTranslator, createLanguageModel } from "typechat";
import { processRequests } from "typechat/interactive";
import { createTypeScriptJsonValidator } from "typechat/ts";
import { SentimentResponse } from "./sentimentSchema";

Expand Down
3 changes: 2 additions & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"exports": {
".": "./dist/index.js",
"./ts": "./dist/ts/index.js",
"./zod": "./dist/zod/index.js"
"./zod": "./dist/zod/index.js",
"./interactive": "./dist/interactive/index.js"
},
"engines": {
"node": ">=18"
Expand Down
1 change: 0 additions & 1 deletion typescript/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './result';
export * from './model';
export * from './typechat';
export * from './interactive';
1 change: 1 addition & 0 deletions typescript/src/interactive/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './interactive';
File renamed without changes.

0 comments on commit 6a15d78

Please sign in to comment.