Make sure you have the dataidea package installed. You can install as
Install DATAIDEA
pipinstall-Udataidea
Note
You also need an api key and a project for your logs, you can create them from the dataidea logger website
Setup your api key in a dot env file with a name like DATAIDEA_API_KEY
Read the api key
Get API Key
importosapi_key=os.getenv('DATAIDEA_API_KEY')
Log an interraction
Log LLM interraction
fromdataidea.loggerimportllm_logllm_log({'api_key':api_key,'project_name':'Test Project','user_id':'1234567890','source':'gpt-4o','query':'This is a test query','response':'This is a test response','metadata':{'extra':'extra info'}})