MCPcopy Create free account
hub / github.com/algorithmicsuperintelligence/optillm / get_llm_response

Function get_llm_response

scripts/eval_frames_benchmark.py:36–49  ·  view source on GitHub ↗
(prompt: str, model: str)

Source from the content-addressed store, hash-verified

34 return f"Here are the relevant Wikipedia articles:\n{wiki_links}\n\nBased on all the information, answer the query. \n\nQuery: {prompt}\n\n"
35
36def get_llm_response(prompt: str, model: str) -> str:
37 response = client.with_options(timeout=1000.0).chat.completions.create(
38 model=model,
39 messages=[
40 {"role": "system", "content": "You are a helpful assistant."},
41 {"role": "user", "content": prompt}
42 ],
43 max_tokens=1000,
44 n=1,
45 stop=None,
46 temperature=0.7,
47 extra_body={"optillm_approach": "readurls&memory"}
48 )
49 return response.choices[0].message.content.strip()
50
51def evaluate_response(question: str, llm_response: str, ground_truth: str, model: str) -> Dict[str, str]:
52 evaluation_prompt = f"""===Task===

Callers 1

mainFunction · 0.70

Calls 1

createMethod · 0.45

Tested by

no test coverage detected