Custom RAG Adapter
DynamoEval provides the following APIs to manage custom RAG applications:
Custom RAG Application
Create Custom Rag Application
Creates and registers a new Custom RAG Application with specified configurations.
Method Parameters
base_url | required string
The base URL for the RAG application.
auth_type | required AuthTypeEnum
Authentication type (AuthTypeEnum.NO_AUTH, AuthTypeEnum.BEARER).
auth_config | optional dict
Authentication configuration parameters.
custom_rag_application_routes | optional list
List of route configurations.
Returns
CustomRagApplicationResponseEntity object.
You can create a Custom RAG Application in several ways:
- Basic creation without authentication:
from dynamofl.entities import AuthTypeEnum
custom_rag_app = dfl.create_custom_rag_application(
base_url="https://api.example.com",
auth_type=AuthTypeEnum.NO_AUTH
)
- Creation with authentication configuration:
from dynamofl.entities import AuthTypeEnum
custom_rag_app = dfl.create_custom_rag_application(
base_url="https://api.example.com",
auth_type=AuthTypeEnum.BEARER,
auth_config={
"token": "bearer-token"
}
)
- Creation along with route configuration:
from dynamofl.entities import CustomRagApplicationRoutesEntity, AuthTypeEnum, RouteTypeEnum
custom_rag_application_routes = [
CustomRagApplicationRoutesEntity(
route_type=RouteTypeEnum.RETRIEVE,
route_path="/retrieve",
request_transformation_expression=None,
response_transformation_expression=None,
)
]
custom_rag_app = dfl.create_custom_rag_application(
base_url="https://api.example.com",
auth_type=AuthTypeEnum.NO_AUTH,
custom_rag_application_routes=custom_rag_application_routes
)
Update Custom Rag Application
Updates an existing Custom RAG Application's base configuration.
Method Parameters
custom_rag_application_id | required int
The unique identifier of the RAG application to update.
base_url | required string
The new base URL for the RAG application.
auth_type | required AuthTypeEnum
Authentication type (AuthTypeEnum.NO_AUTH, AuthTypeEnum.BEARER).
auth_config | optional dict
The new authentication configuration parameters.
Returns: CustomRagApplicationResponseEntity
from dynamofl.entities import AuthTypeEnum
updated_app = dfl.update_custom_rag_application(
custom_rag_application_id=123,
base_url="https://api.example.com",
auth_type=AuthTypeEnum.BEARER,
auth_config={"token": "bearer-token"}
)
Get All Custom Rag Applications
Retrieves all registered Custom RAG Applications.
Method Parameters
include_routes | optional bool
Whether to include route details in the response. Defaults to False.
Returns: AllCustomRagApplicationResponseEntity
all_apps = dfl.get_all_custom_rag_applications(include_routes=True)
Get Custom Rag Application
Retrieves details of a specific Custom RAG Application.
Method Parameters
custom_rag_application_id | required int
The unique identifier of the RAG application to retrieve.
include_routes | optional bool
Whether to include route details in the response. Defaults to False.
Returns: List[CustomRagApplicationResponseEntity]
app = dfl.get_custom_rag_application(
custom_rag_application_id=123,
include_routes=True
)
Delete Custom Rag Application
Removes a Custom RAG Application from the system.
Method Parameters
custom_rag_application_id | required int
The unique identifier of the RAG application to delete.
Returns: None
dfl.delete_custom_rag_application(custom_rag_application_id=123)
Routes
Create Route
Adds a new route to an existing Custom RAG Application.
Method Parameters
custom_rag_application_id | required int
The ID of the RAG application to which the route belongs.
route_type | required RouteTypeEnum
Route type (RouteTypeEnum.RETRIEVE).
route_path | required string
The URL path defining the route.
request_transformation_expression | optional string
JSONata expression to transform incoming requests.
response_transformation_expression | optional string
JSONata expression to transform outgoing responses.
Returns: List[CustomRagApplicationRoutesResponseEntity]
from dynamofl.entities import RouteTypeEnum
new_route = dfl.create_custom_rag_application_route(
custom_rag_application_id=123,
route_type=RouteTypeEnum.RETRIEVE,
route_path="/retrieve",
request_transformation_expression="...",
response_transformation_expression="..."
)
Update Route
Updates an existing route in a Custom RAG Application.
Method Parameters
custom_rag_application_id | required int
The ID of the RAG application to which the route belongs.
route_id | required int
The unique identifier of the route to update.
route_type | required RouteTypeEnum
Route type (RouteTypeEnum.RETRIEVE).
route_path | required string
The new URL path for the route.
request_transformation_expression | optional string
JSONata expression to transform incoming requests.
response_transformation_expression | optional string
JSONata expression to transform outgoing responses.
Returns: CustomRagApplicationRoutesResponseEntity
updated_route = dfl.update_custom_rag_application_route(
custom_rag_application_id=123,
route_id=456,
route_type=RouteTypeEnum.RETRIEVE,
route_path="/new-search",
request_transformation_expression="...",
response_transformation_expression="..."
)
Delete Route
Removes a specific route from a Custom RAG Application.
Method Parameters
custom_rag_application_id | required int
The ID of the RAG application from which to delete the route.
route_id | required int
The unique identifier of the route to delete.
Returns: None
dfl.delete_custom_rag_application_route(
custom_rag_application_id=123,
route_id=456
)