Giter Club home page Giter Club logo

app-service's Introduction

ASAI App Service

Core backend service providing application and AI engine API.

App service supports rest API for authentication, AI engine prompting, and managing the application data and settings. It also supports web socket connection for streaming AI engine results.

The AI engine is currently powered by openai models, with plans to implement Ollama open source models support soon.

Development setup

Clone the repository and install dependencies:

git clone https://github.com/astrosynapseai/app-service

For lsp and intelisense supported development you do need to install go and all the packages locally but it is not required to run the docker compose.

cd app-service
go get
go mod tidy

add a .env.local on web route folder

cd web

create .env.local file with this content:

# hostname
VITE_HOSTNAME=http://localhost:8082
# rest
VITE_API_URL=http://localhost:8082/api
# websocket
VITE_WS_URL=ws://localhost:8082

For local development, the repository comes with a docker-compose.yaml and a Docker file for running the app service with hot reload support using go air package.

To setup the environment make sure you have docker and docker-compose installed on your local machine. To intialize docker container with hot reloading the first time you run a composer run:

docker compose run --rm asai-app air init

After the first run or if you don't want hot reloading, use:

docker compose up

Web Client

Vue based web client is located in ./web folder. To install dependencies run:

cd web
yarn install

Web client has CORS allowed to run alongised with the dockerised server. Run yarn run dev to run the web clinet on port 5173 as usaul. If you need the front end to be serverd at the same port as the dockerised app service, you can run yarn run docker to build the front ned for runing in docker, now the frontend is avaliable on port 8082.

API keys

To authenticate for openai APIs and APIs the agents use, you need to rename keys.template.yaml to keys.yaml and input the required API keys.

open_api_key:    ""
serpapi_api_key: ""
discord_api_key: ""

To run with docker the web client needs to be built "for production" with npm run build, the build will be saved in ./web/static folder.

app-service's People

Contributors

arkon108 avatar cavaevinci avatar luizakp avatar struki84 avatar

Stargazers

 avatar

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.