-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(AI-130): changed model and added missing tools (#14)
* feat(AI-130): changed model and added missing tools * feat(AI-130): bot as an external script
- Loading branch information
1 parent
68396f9
commit 2ca364d
Showing
26 changed files
with
4,044 additions
and
1,396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,4 @@ Thumbs.db | |
.env.* | ||
!.env.dist | ||
/apps/spa/src/assets/uploads | ||
/apps/spa/src/assets/js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h1> | ||
How to add a chatbot to the website? | ||
</h1> | ||
|
||
Please copy the code provided below and paste it into your HTML file. | ||
|
||
<markdown [data]="markdown"></markdown> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import 'settings'; | ||
|
||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: $size-2; | ||
max-width: 600px; | ||
font-size: 16px; | ||
margin: 0 auto; | ||
padding: 40px 20px; | ||
color: var(--color-grey-600); | ||
} |
21 changes: 19 additions & 2 deletions
21
apps/spa/src/app/modules/+chat/containers/chat-example/chat-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
import { Component } from '@angular/core'; | ||
import { AssistantIframe } from '@boldare/ai-iframe'; | ||
import { ChatService } from '../../shared/chat.service'; | ||
import { environment } from '../../../../../environments/environment'; | ||
import { MarkdownComponent, MarkdownPipe } from 'ngx-markdown'; | ||
import { AsyncPipe } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'ai-chat-example', | ||
standalone: true, | ||
templateUrl: './chat-example.component.html', | ||
styleUrl: './chat-example.component.scss', | ||
imports: [ | ||
MarkdownComponent, | ||
MarkdownPipe, | ||
AsyncPipe, | ||
], | ||
}) | ||
export class ChatExampleComponent { | ||
iframe = new AssistantIframe({ url: `${environment.appUrl}/chat/iframe` }); | ||
markdown = `\`\`\`html | ||
<script | ||
src="${environment.appUrl}/assets/js/ai-embedded.js" | ||
type="module" | ||
defer | ||
></script> | ||
\`\`\``; | ||
|
||
constructor(private readonly chatService: ChatService,) { | ||
this.chatService.loadScript(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ai-embedded | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Building | ||
|
||
Run `nx build ai-embedded` to build the library. | ||
|
||
## Running unit tests | ||
|
||
Run `nx test ai-embedded` to execute the unit tests via [Jest](https://jestjs.io). |
4 changes: 2 additions & 2 deletions
4
libs/ai-iframe/jest.config.ts → libs/ai-embedded/jest.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'ai-iframe', | ||
displayName: 'ai-embedded', | ||
preset: '../../jest.preset.js', | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }], | ||
}, | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
coverageDirectory: '../../coverage/libs/ai-iframe', | ||
coverageDirectory: '../../coverage/libs/ai-embedded', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@boldare/ai-iframe", | ||
"name": "@boldare/ai-embedded", | ||
"version": "0.0.1", | ||
"dependencies": {}, | ||
"type": "commonjs", | ||
"main": "./index.cjs" | ||
"main": "./index.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "ai-embedded", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "libs/ai-embedded/src", | ||
"projectType": "library", | ||
"targets": { | ||
"build": { | ||
"executor": "@nx/esbuild:esbuild", | ||
"outputs": ["{options.outputPath}"], | ||
"options": { | ||
"outputPath": "dist/libs/ai-embedded", | ||
"main": "libs/ai-embedded/src/index.ts", | ||
"tsConfig": "libs/ai-embedded/tsconfig.lib.json", | ||
"assets": ["libs/ai-embedded/*.md"], | ||
"generatePackageJson": false, | ||
"format": ["esm"] | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"outputs": ["{options.outputFile}"] | ||
}, | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
"options": { | ||
"jestConfig": "libs/ai-embedded/jest.config.ts" | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { AssistantIframe } from './lib/assistant-iframe'; | ||
|
||
export * from './lib/assistant-iframe'; | ||
export * from './lib/assistant-iframe.model'; | ||
|
||
(function () { | ||
new AssistantIframe(); | ||
})(); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.