Skip to content

Instantly share code, notes, and snippets.

@sushmithapopuri
Created June 2, 2024 11:03
Show Gist options
  • Select an option

  • Save sushmithapopuri/0b87cc77327f3f8f54d053e457263f06 to your computer and use it in GitHub Desktop.

Select an option

Save sushmithapopuri/0b87cc77327f3f8f54d053e457263f06 to your computer and use it in GitHub Desktop.
import openai
import os
os.environ['REQUESTS_CA_BUNDLE'] = r'C:\Users\popurisu\OneDrive - Dun and Bradstreet\Desktop\Projects\ai-bot\sni.cloudflaressl.der'
openai.api_key = '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'
def get_completion(prompt, model="gpt-3.5-turbo"):
messages = [{"role": "user", "content": prompt}]
response = openai.ChatCompletion.create(model=model,messages=messages,temperature=0)
return response.choices[0].message["content"]
prompt = 'Is this AI generated text: {}'.format('This statement means that individuals who have completed a B.Tech or B.E. (Bachelor of Technology or Bachelor of Engineering) from Central Funded Technical Institutes (CFTIs) with a minimum Cumulative Grade Point Average (CGPA) of 7.5 are not required to take a national-level examination to qualify for an institute fellowship. However, this waiver does not apply to those who are self-sponsored, sponsored by an industry, or pursuing their studies on a part-time basis. In summary, students meeting the specified criteria from certain institutions do not need to take a national-level exam to receive an institute fellowship, but this exemption is not available to others.')
response = get_completion(prompt)
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment