MCPcopy Create free account
hub / github.com/RootbeerComputer/backend-GPT / gpt3

Function gpt3

backend/server.py:10–17  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

8enc = tiktoken.get_encoding("gpt2")
9openai.api_key = # put key here
10def gpt3(input):
11 completion = openai.Completion.create(
12 prompt=input,
13 model="text-davinci-003",
14 max_tokens=4000-len(enc.encode(input)),
15 temperature=0
16 )
17 return completion.choices[0].text
18
19def dict_to_json(d):
20 return d.__dict__

Callers 1

apiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected