Skip to content

joaquin-alfaro/ai-api-gateway-parent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai-api-gateway

API Gateway that solves requests by mapping OpenAPI specification with AI Tools.

Requests to the API Gateway are infered to the LLM model that determines the API to be called using the set of AI Tools defined from API Rest services.

ai-api-gateway

✅ Features

  • Mapping of OpenAPI specification to AI Tools
  • Register of API services in the gateway
  • API Rest to invoke the gateway
  • Support to MCP protocol

🧩 Components

ai-api-gateway

Implementation of ai-api-gateway

ecommerce-booking

Dummy implementation of an API that implements the booking funnel of a CRS.

ecommerce-booking

Dummy implementation of an API that implements operations to query products - e.g. hotels - in a CRS.

🔧 Setup

Define the URL of services proxied by ai-api-gateway in property formentor.ai.services of application.yml

server:
  port: 7001 # Like "TOOL"
spring:
  application:
    name: ai-gateway

formentor:
  ai:
    services:
      # Service "booking" to book a hotel
      - "http://localhost:8080/v3/api-docs.yaml"
      # Service "product" to get hotels
      - "http://localhost:8082/v3/api-docs.yaml"
    ollama:
      host: "http://localhost:11434"
      model: "llama3.1:8b"

🚀 Usage

  1. Start Ollama server
ollama serve

# Pull the model llama3.1:8b (if necessary)
ollama pull llama3.1:8b
  1. Start dummy services to test ai-api-gateway
cd ecommerce-product
mvn spring-boot:run

cd ecommerce-booking
mvn spring-boot:run
  1. Start ai-api-gateway
cd ai-api-gateway
mvn spring-boot:run
  1. Send requests to ai-api-gateway
# Get hotels available in Madrid
curl --location 'http://localhost:7001/invoke?m=Give me hotels in Madrid'

# Get price for a stay of 5 nights in Hotel Castilla
curl --location 'http://localhost:7001/invoke?m=How much does it cost 5 night in Hotel Castilla for 2025/08/05

About

API Gateway that maps OpenAPI with AI Tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages