def llm_evaluate(sentences,sampled_passages): prompt = f"""You will be provided with a text passage and your task is to rate the consistency of that text to that of the provided context. Your answer must be only a number between 0.0 and 1.0 rounded to the nearest two decimal places where 0.0 represents no consistency and 1.0 represents perfect consistency and similarity. nn Text passage: {sentences}. nn Context: {sampled_passages[0]} nn {sampled_passages[1]} nn {sampled_passages[2]}.""" completion = client.chat.completions.create( model="gpt-3.5-turbo", messages=[ {"role": "system", "content": ""}, {"role": "user", "content": prompt} ] ) return completion.choices[0].message.content