MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / ask_completion

Function ask_completion

llm/chatgpt.py:17–32  ·  view source on GitHub ↗
(model, batch, temperature)

Source from the content-addressed store, hash-verified

15
16
17def ask_completion(model, batch, temperature):
18 response = openai.Completion.create(
19 model=model,
20 prompt=batch,
21 temperature=temperature,
22 max_tokens=200,
23 top_p=1,
24 frequency_penalty=0,
25 presence_penalty=0,
26 stop=[";"]
27 )
28 response_clean = [_["text"] for _ in response["choices"]]
29 return dict(
30 response=response_clean,
31 **response["usage"]
32 )
33
34
35def ask_chat(model, messages: list, temperature, n):

Callers 1

ask_llmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected