GuidesGetting Started

Predefined Request IDs

Learn how to predefine CoreValue request IDs for advanced tracking and asynchronous operations in your LLM applications.

One of the significant advantages of using UUIDs as request IDs is the ability to predetermine the request ID before the actual request is dispatched to CoreValue.

This feature facilitates the tracking of request IDs without the necessity of receiving a response from CoreValue.


import uuid

# Define request ID
my_corevalue_request_id = str(uuid.uuid4())

# Request to LLM provider
...
    "Cova-Request-Id": my_corevalue_request_id
...

# While the above code is executing, you can perform other tasks such as providing feedback on a specific request.
import requests
url = 'https://api.corevalue.dev/v1/feedback'
headers = {
    'Authorization': f'Bearer {os.getenv("COVA_API_KEY")}',
    'Content-Type': 'application/json'
}
data = {
    'corevalue-id': my_corevalue_request_id,
    'rating': True # true for positive, false for negative
}
response = requests.post(url, headers=headers, json=data)

This functionality is particularly beneficial when associating different requests with different jobs or other features within CoreValue.