openai-cookbook
openai-cookbook copied to clipboard
Examples and guides for using the OpenAI API
## Suggested improvements to **web-qa.py** file. - support international characters (by using **utf-8** encoding) - try-except around scrapped file write ## Changes Row 138: replace ```python with open('text/'+local_domain+'/'+url[8:].replace("/", "_") +...
version 5.13 worked fine.
This pull request fixes the UnicodeEncodeError in the code by adding encoding="utf-8" to the open() function calls.
Contribute a web wiki Hello, recently used your repository's knowledge base to make an introduction site [openai-cookbook-wiki](https://boxtrade.github.io/openai-cookbook-wiki/#/) , if you find it useful you can [fork me](https://github.com/boxtrade/openai-cookbook-wiki) and redeploy or...
Remove unmatched closing brackets ")". The added unmatched ")" causes a syntax error. Removing it fixes the error.
``` search_file = openai.File.create( file=open("olympics-data/olympics_search.jsonl"), purpose='search' ) ``` openai.error.InvalidRequestError: 'search' is not one of ['fine-tune'] - 'purpose'
Is there a way if I want to query a model for a similar question + set of instruction to avoid passing the instruction every time? eg. ``` python prompt...
Added an example for using Pinecone vector DB with Open AI embedding and completion endpoints for retrieval-augmented generative QA