GithubHelp home page GithubHelp logo

stylepatrick / spring-ai-chat-bot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 8.52 MB

Demonstrates various AI functionalities using Spring AI, including chat responses, JSON data handling, image creation and description, real-time data loading, text-to-speech, and vector store usage.

Java 97.68% Smalltalk 2.32%
rest-api spring spring-ai spring-openapi chatbot custom-data vectorstore openai-functions

spring-ai-chat-bot's Introduction

Spring AI Chat Bot

This project demonstrates various AI functionalities using Spring AI. It includes capabilities for generating chat responses, handling JSON formatted data, creating images, describing images, loading real-time data via APIs with Open AI Functions, generating speech from text, and utilizing a vector store for custom data.

API POST-Requests:

General Message to AI

  • URL: http://localhost:8080/api/generalMessage
  • Description: Sends a general message to AI for a response. General Message

Get Biggest Customers

  • URL: http://localhost:8080/api/biggestCustomers
  • Description: Retrieves the biggest customers for a given company in JSON format. Biggest Customers

Get Headquarters for a Company

  • URL: http://localhost:8080/api/companyHeadquarters
  • Description: Gets the headquarters of a given company in JSON format. Company Headquarters

Generate an Image from Text

  • URL: http://localhost:8080/api/image
  • Description: Generates an image from a given text using DALLE. Image Generation

Load Real-Time Data via API

  • URL: http://localhost:8080/api/weatherService
  • Description: Uses AI functions to load actual data from an API request and generate a response. Weather Service

Describe an Image

  • URL: http://localhost:8080/api/describeImage
  • Description: Uses OpenAI vision to describe the content of an image. Image Description

Generate Speech from Text

  • URL: http://localhost:8080/api/talk
  • Description: Generates speech from a given text. Text to Speech

Describe an Image with Speech

  • URL: http://localhost:8080/api/describeImageWithSpeech
  • Description: Describes an image with generated speech. Image Description with Speech

Use a Vector Store for Custom Data

  • URL: http://localhost:8080/vectorstore/message
  • Description: Uses a vector store to build embeddings on custom data. Vector Store Message

Vector Store Setup in PostgreSQL

CREATE EXTENSION IF NOT EXISTS vector;
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

CREATE TABLE IF NOT EXISTS vector_store (
    id uuid DEFAULT uuid_generate_v4() PRIMARY KEY,
    content text,
    metadata json,
    embedding vector(1536)
);

CREATE INDEX ON vector_store USING HNSW (embedding vector_cosine_ops);

spring-ai-chat-bot's People

Contributors

stylepatrick avatar

Watchers

 avatar

Forkers

pppnnn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.