MCPcopy Create free account
hub / github.com/VILA-Lab/ATLAS / generate_answers

Function generate_answers

generate.py:7–16  ·  view source on GitHub ↗
(instructions, gpt_model="gpt-4-1106-preview")

Source from the content-addressed store, hash-verified

5client = OpenAI(api_key=os.environ['OPENAI_KEY'])
6
7def generate_answers(instructions, gpt_model="gpt-4-1106-preview"):
8 data = []
9 for prompt in instructions:
10 response = client.chat.completions.create(messages=[{
11 "role": "user",
12 "content": prompt
13 }],
14 model=gpt_model)
15 data.append(response.choices[0].message.content)
16 return data
17
18def extract_questions_from_file(file_path):
19 questions = []

Callers 1

generate.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected