From b206a1eb6364e519741ceb89e3f3b63910b4e1ef Mon Sep 17 00:00:00 2001 From: Raju Komati Date: Fri, 28 Apr 2023 02:27:06 +0530 Subject: update openai_rev module add test file with simple use --- openai_rev/phind/README.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 openai_rev/phind/README.md (limited to 'openai_rev/phind') diff --git a/openai_rev/phind/README.md b/openai_rev/phind/README.md deleted file mode 100644 index 85288c06..00000000 --- a/openai_rev/phind/README.md +++ /dev/null @@ -1,37 +0,0 @@ -### Example: `phind` (use like openai pypi package) - -```python - -from openai_rev import phind - -# set cf_clearance cookie (needed again) -phind.cf_clearance = 'xx.xx-1682166681-0-160' -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' # same as the one from browser you got cf_clearance from - -prompt = 'who won the quatar world cup' - -# help needed: not getting newlines from the stream, please submit a PR if you know how to fix this -# stream completion -for result in phind.StreamingCompletion.create( - model='gpt-4', - prompt=prompt, - results=phind.Search.create(prompt, actualSearch=True), - # create search (set actualSearch to False to disable internet) - creative=False, - detailed=False, - codeContext=''): # up to 3000 chars of code - - print(result.completion.choices[0].text, end='', flush=True) - -# normal completion -result = phind.Completion.create( - model='gpt-4', - prompt=prompt, - results=phind.Search.create(prompt, actualSearch=True), - # create search (set actualSearch to False to disable internet) - creative=False, - detailed=False, - codeContext='') # up to 3000 chars of code - -print(result.completion.choices[0].text) -``` -- cgit v1.2.3