Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mike dupont committed Feb 26, 2025
1 parent 7443b55 commit 96e5160
Show file tree
Hide file tree
Showing 8 changed files with 229 additions and 33 deletions.
7 changes: 5 additions & 2 deletions scripts/jsdoc-automation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,26 @@
"build": "tsup",
"dev": "tsup --watch",
"start": "node dist/index.js",
"start_ts": "node --loader ts-node/esm src/index.ts",
"clean": "rm -rf node_modules dist"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@langchain/openai": "^0.3.16",
"@hapi/shot": "^6.0.1",
"@octokit/rest": "^21.0.2",
"@types/node": "^20.11.0",
"@typescript-eslint/parser": "6.18.1",
"@typescript-eslint/types": "6.18.1",
"@typescript-eslint/typescript-estree": "6.18.1",
"dotenv": "^16.4.7",
"langchain": "^0.3.7",
"langsmith": "^0.3.11",
"yaml": "^2.3.4"
},
"devDependencies": {
"@types/hapi": "^18.0.14",
"@types/node": "^20.17.10",
"ts-node": "^10.9.2",
"tsup": "^8.3.5",
"typescript": "5.3.3"
Expand Down
173 changes: 167 additions & 6 deletions scripts/jsdoc-automation/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion scripts/jsdoc-automation/src/AIService/AIService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { TypeScriptParser } from "../TypeScriptParser.js";
import { CodeFormatter } from "./utils/CodeFormatter.js";
import { DocumentOrganizer } from "./utils/DocumentOrganizer.js";

//import { wrapOpenAI } from "langsmith/wrappers";
//import { FakeListChatModel } from "@langchain/core/utils/testing";


dotenv.config();

/**
Expand All @@ -13,7 +17,7 @@ dotenv.config();
export class AIService {
private chatModel: ChatOpenAI;
private codeFormatter: CodeFormatter;
private chatModelFAQ: ChatOpenAI;
private chatModelFAQ: ChatOpenAI; //FakeListChatModel

/**
* Constructor for initializing the ChatOpenAI instance.
Expand All @@ -22,6 +26,7 @@ export class AIService {
* @throws {Error} If OPENAI_API_KEY environment variable is not set
*/
constructor(private configuration: Configuration) {

if (!process.env.OPENAI_API_KEY) {
throw new Error("OPENAI_API_KEY is not set");
}
Expand All @@ -30,6 +35,13 @@ export class AIService {
apiKey: process.env.OPENAI_API_KEY,
model: "gpt-4o",
});

// both not working
// this.chatModel = wrapOpenAI(new ChatOpenAI({ apiKey: process.env.OPENAI_API_KEY }));
// this.chatModelFAQ = wrapOpenAI(new ChatOpenAI({ apiKey: process.env.OPENAI_API_KEY, model: "gpt-4o", }));
// this.chatModel = new FakeListChatModel({ responses: []});
// this.chatModelFAQ = new FakeListChatModel({ responses: [] });

this.codeFormatter = new CodeFormatter();
}

Expand Down
Loading

0 comments on commit 96e5160

Please sign in to comment.