|
import phind |
|
|
|
|
|
phind.cf_clearance = '' |
|
phind.user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' |
|
|
|
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-4', |
|
prompt = prompt, |
|
results = phind.Search.create(prompt, actualSearch = True), |
|
creative = False, |
|
detailed = False, |
|
codeContext = ''): |
|
|
|
print(result.completion.choices[0].text, end='', flush=True) |