A flexible Haystack 2.0 pipeline integrating Retrieval-Augmented Generation (RAG) with any OpenAPI service
APACHE-2.0 License
vblagoje/openapi-rag-service
demonstrates the seamless integration of OpenAPI-defined services with Large Language Models (LLMs) in the Haystack RAG (Retriever-Augmented Generation) pipeline. This project offers an easy way to explore the enhanced capabilities of Haystack's 2.x RAG architecture, enriching LLMs with structured data from various OpenAPI services. The vblagoje/openapi-rag-service Docker image facilitates quick experimentation, opening new possibilities for enriching LLM outputs in the RAG framework.
To run the vblagoje/openapi-rag-service
, pull the Docker image and execute it with the necessary parameters:
docker pull vblagoje/openapi-rag-service:latest
docker run <additional-parameters> vblagoje/openapi-rag-service
Configure the service using the following environment variables:
OPENAI_API_KEY
: Your API key for OpenAI.OPENAI_BASE_URL
: The base URL for the OpenAI API.TEXT_GENERATION_MODEL
: Name of the model used for text generation (e.g., gpt-4-1106-preview
).FUNCTION_CALLING_MODEL
: Model name for handling function calls (e.g., gpt-3.5-turbo-0613
).SYSTEM_PROMPT
: System message or prompt URL to assist the model in generating content.FUNCTION_CALLING_PROMPT
: Prompt for the function calling model.USER_PROMPT
: Additional user-defined prompt for guided output text generation.FUNCTION_CALLING_VALIDATION_SCHEMA
: Schema URL or json text for validating OpenAPI function calls (adds correction loop)BOT_NAME
: Bot name used in guiding the generation process.OPENAPI_SERVICE_SPEC
: URL or path to the OpenAPI service specification.OPENAPI_SERVICE_TOKEN
: Token for authenticating with the specified OpenAPI service.SERVICE_RESPONSE_SUBTREE
: Specific subtree to parse in the service response.OUTPUT_KEY
: Json key for the output of the text generation (if not the output is not a json)OUTPUT_SCHEMA
: Schema URL or json text defining the output format.QUIET
: Set to true
to disable output to standard output (STDOUT).TODO
Licensed under (LICENCE)[LICENCSE]