On Keywords AI, we built a Users page to help you understand your users and their behavior on your LLM applications. With our user analytics feature, you can;
You can pass a customer_params to the request to track the user’s behavior on your LLM applications.
Here is an example of how to send a user’s data with the parameter customer_params to Keywords AI in the OpenAI Python SDK.
from openai import OpenAIclient = OpenAI( base_url="https://api.keywordsai.co/api/", api_key="YOUR_KEYWORDSAI_API_KEY",)response = client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "user", "content": "Tell me a long story"} ], extra_body={ "customer_params": { "customer_identifier": "customer_1", "name": "Hendrix Liu", # optional parameter "email": "hendrix@keywordsai.co" # optional parameter } })
Here is an example of how to send a user’s data with the parameter customer_params to Keywords AI in the OpenAI Python SDK.
from openai import OpenAIclient = OpenAI( base_url="https://api.keywordsai.co/api/", api_key="YOUR_KEYWORDSAI_API_KEY",)response = client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "user", "content": "Tell me a long story"} ], extra_body={ "customer_params": { "customer_identifier": "customer_1", "name": "Hendrix Liu", # optional parameter "email": "hendrix@keywordsai.co" # optional parameter } })
Here is an example of how to send a user’s data with the parameter customer_params to Keywords AI in the OpenAI TypeScript SDK. In OpenAI TypeScript SDK, you should add a // @ts-expect-error before the metadata field.