-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : create chatbot using openai and springai (#59)
* feat : create chatbot using openai and springai * feat : change permission * fix : issue with file name * fix : merge conflicts issue * feat : clean dead code * feat : fix compilation issue * feat : using milvus vector store
- Loading branch information
1 parent
1f45d8d
commit 33b1f57
Showing
21 changed files
with
1,016 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: chatbot-openai-springai CI Build | ||
|
||
on: | ||
push: | ||
paths: | ||
- "chatbot/chatbot-openai-springai/**" | ||
branches: [main] | ||
pull_request: | ||
paths: | ||
- "chatbot/chatbot-openai-springai/**" | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
build: | ||
name: Run Unit & Integration Tests | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: chatbot/chatbot-openai-springai | ||
strategy: | ||
matrix: | ||
distribution: [ 'temurin' ] | ||
java: [ '21' ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
|
||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/[email protected] | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: ${{ matrix.distribution }} | ||
cache: 'maven' | ||
- name: Build and analyze | ||
run: ./mvnw clean verify |
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,33 @@ | ||
HELP.md | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/**/target/ | ||
!**/src/test/**/target/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### VS Code ### | ||
.vscode/ |
18 changes: 18 additions & 0 deletions
18
chatbot/chatbot-openai-springai/.mvn/wrapper/maven-wrapper.properties
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,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
wrapperVersion=3.3.1 | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip |
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,48 @@ | ||
# chatbot-openapi-springai | ||
|
||
|
||
## Sequence Diagram | ||
|
||
Before Vector Store | ||
|
||
```mermaid | ||
sequenceDiagram | ||
participant User | ||
participant ChatbotController | ||
participant ChatbotService | ||
participant ChatModel | ||
participant ChatMemory | ||
User->>ChatbotController: POST /api/ai/chat | ||
ChatbotController->>ChatbotService: chat(message) | ||
ChatbotService->>ChatModel: generateResponse(message) | ||
ChatModel-->>ChatbotService: response | ||
ChatbotService->>ChatMemory: saveInteraction(message, response) | ||
ChatbotService-->>ChatbotController: response | ||
ChatbotController-->>User: response | ||
``` | ||
|
||
After Vector Store | ||
|
||
```mermaid | ||
sequenceDiagram | ||
participant User | ||
participant ChatbotController | ||
participant ChatbotService | ||
participant ChatService | ||
participant ChatMemory | ||
participant VectorStore | ||
User->>ChatbotController: POST /api/ai/chat | ||
ChatbotController->>ChatbotService: chat(message) | ||
ChatbotService->>ChatService: Process Chat Request | ||
ChatService->>ChatMemory: Retrieve Memory | ||
ChatService->>VectorStore: Retrieve Vectors | ||
ChatMemory-->>ChatService: Return Memory Data | ||
VectorStore-->>ChatService: Return Vector Data | ||
ChatService-->>ChatbotService: Processed Response | ||
ChatbotService-->>ChatbotController: response | ||
ChatbotController-->>User: response | ||
``` |
Oops, something went wrong.