code: from langfuse import Langfuse
  from llama_index.llms.openai import OpenAI
  import llama_index.core
  llama_index.core.set_global_handler("langfuse")
  from llama_index.core.llms import ChatMessage
  
  langfuse = Langfuse()
  dataset = langfuse.get_dataset("term-extraction")
  prompt = langfuse.get_prompt("extraction-prompt-1")
  
  model = OpenAI(model="gpt-4-turbo-preview")
  for item in dataset.items:
    compiled_prompt = prompt.compile(input=item.input)
    generation = langfuse.generation(prompt=prompt,model=model.model)
    messages = [
        ChatMessage(role="system", content="You are an API that must always respond with a json without any formatting."),
        ChatMessage(role="user", content=compiled_prompt),
    ]
  
    chat_completion = model.chat(messages)
    print(chat_completion)
    item.link(generation, "gpt-4-with-api-instructions")
  
    generation.end(output=chat_completion)
    
    # item.link(generation, "first-run-extraction")
apis: llama_index.core.llms.ChatMessage llama_index.llms.openai.OpenAI
extract_api: [((203, 213), 'langfuse.Langfuse', 'Langfuse', ([], {}), '()\n', (211, 213), False, 'from langfuse import Langfuse\n'), ((325, 360), 'llama_index.llms.openai.OpenAI', 'OpenAI', ([], {'model': '"""gpt-4-turbo-preview"""'}), "(model='gpt-4-turbo-preview')\n", (331, 360), False, 'from llama_index.llms.openai import OpenAI\n'), ((530, 653), 'llama_index.core.llms.ChatMessage', 'ChatMessage', ([], {'role': '"""system"""', 'content': '"""You are an API that must always respond with a json without any formatting."""'}), "(role='system', content=\n    'You are an API that must always respond with a json without any formatting.'\n    )\n", (541, 653), False, 'from llama_index.core.llms import ChatMessage\n'), ((651, 700), 'llama_index.core.llms.ChatMessage', 'ChatMessage', ([], {'role': '"""user"""', 'content': 'compiled_prompt'}), "(role='user', content=compiled_prompt)\n", (662, 700), False, 'from llama_index.core.llms import ChatMessage\n')]