|
import phind |
|
|
|
|
|
phind.cf_clearance = 'hWfIdYKgcnxnU5ayolWe9t7eEmAbULywS.qfHkm1T_A-1682166681-0-160' |
|
|
|
prompt = 'hello world' |
|
|
|
|
|
result = phind.Completion.create( |
|
model = 'gpt-4', |
|
prompt = prompt, |
|
results = phind.Search.create(prompt, actualSearch = False), |
|
creative = False, |
|
detailed = False, |
|
codeContext = '') |
|
|
|
print(result.completion.choices[0].text) |
|
|
|
prompt = 'who won the quatar world cup' |
|
|
|
|
|
|
|
for result in phind.StreamingCompletion.create( |
|
model = 'gpt-3.5', |
|
prompt = prompt, |
|
results = phind.Search.create(prompt, actualSearch = True), |
|
creative = False, |
|
detailed = False, |
|
codeContext = ''): |
|
|
|
print(result.completion.choices[0].text, end='', flush=True) |