Last active
October 5, 2023 23:58
-
-
Save ecdedios/8792417ec5e1c087acf3074be4e86bb7 to your computer and use it in GitHub Desktop.
semantic kernel chatgpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import semantic_kernel as sk | |
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion | |
kernel = sk.Kernel() | |
api_key, org_id = sk.openai_settings_from_dot_env() | |
kernel.add_text_completion_service("dv", OpenAIChatCompletion("gpt-3.5-turbo", api_key, org_id)) | |
with open('resume.txt', encoding='utf-8') as f: | |
lines = f.readlines() | |
user_input = input('\nWhat is your question? ') | |
prompt = ' '.join(lines) + ' ' + user_input | |
response = kernel.create_semantic_function(prompt) | |
print(response()) | |
print("\n\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment