Skip to content

Commit

Permalink
96 assemble a basic llm chains (#97)
Browse files Browse the repository at this point in the history
* added llmGateWay and LlmChain and updated OpenAI newest version

* small fix in slicing conversation in memory

* small fix in the llm-chain

* added unit test

* formatting with prettier

* small fix and added unit test for llm-connection-gateway
  • Loading branch information
dominhnhut01 authored Mar 15, 2024
1 parent eca45b3 commit 77da7b6
Show file tree
Hide file tree
Showing 25 changed files with 673 additions and 267 deletions.
Empty file.
2 changes: 2 additions & 0 deletions new-chatbot-app/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
200 changes: 167 additions & 33 deletions new-chatbot-app/package-lock.json

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

2 changes: 1 addition & 1 deletion new-chatbot-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@nestjs/platform-socket.io": "^10.3.3",
"@nestjs/websockets": "^10.3.3",
"eslint-plugin-unused-imports": "^3.1.0",
"openai": "^3.3.0",
"openai": "^4.28.4",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1"
},
Expand Down
5 changes: 2 additions & 3 deletions new-chatbot-app/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Module } from '@nestjs/common';
import { LlmChainModule } from './llm-chain/llm-chain.module';
import { LibraryApiModule } from './library-api/library-api.module';
import { ChatGateway } from './chat/chat.gateway';
import { SharedModule } from './shared/shared.module';
import { GatewayModule } from './gateway/gateway.module';

@Module({
imports: [LlmChainModule, LibraryApiModule, SharedModule],
providers: [ChatGateway],
imports: [LlmChainModule, LibraryApiModule, SharedModule, GatewayModule],
})
export class AppModule {}
22 changes: 0 additions & 22 deletions new-chatbot-app/src/chat/chat.gateway.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Test, TestingModule } from '@nestjs/testing';
import { ChatGateway } from './chat.gateway';
import { LlmConnectionGateway } from '../connection/llm-connection.gateway';

describe('ChatGateway', () => {
let gateway: ChatGateway;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [ChatGateway],
providers: [ChatGateway, LlmConnectionGateway],
}).compile();

gateway = module.get<ChatGateway>(ChatGateway);
Expand Down
Loading

0 comments on commit 77da7b6

Please sign in to comment.