This file contains hidden or 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
Console.WriteLine("Console bassed calculator\n"); | |
Console.WriteLine("========================"); | |
bool continueCalculating = true; | |
while (continueCalculating) | |
{ | |
Console.WriteLine("Enter your first number: "); | |
string? firstInput = Console.ReadLine(); | |
if (firstInput == null) |
This file contains hidden or 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 os | |
from dotenv import load_dotenv | |
load_dotenv() | |
api_key = os.getenv("OPENAI_API_KEY") | |
from openai import OpenAI | |
client = OpenAI() | |
famous_person = input("What celebrity would you like to talk to?\n") |
This file contains hidden or 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 random | |
# Board setup and functions | |
def print_board(board): | |
print(f'{board[0]} | {board[1]} | {board[2]}') | |
print('---------') | |
print(f'{board[3]} | {board[4]} | {board[5]}') | |
print('---------') | |
print(f'{board[6]} | {board[7]} | {board[8]}') |
This file contains hidden or 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 pygame | |
import time | |
import random | |
# Initialize pygame | |
pygame.init() | |
# Define colors | |
dark_gray = (30, 30, 30) # Background color | |
white = (255, 255, 255) # Score text color |
This file contains hidden or 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 os | |
from dotenv import load_dotenv | |
from openai import OpenAI | |
client = OpenAI() | |
api_key = os.getenv('OPENAI_API_KEY') | |
text = 'In the future, we may be able to travel to other galaxies using wormholes or warp drives.' |
This file contains hidden or 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 os | |
from dotenv import load_dotenv | |
from openai import OpenAI | |
client = OpenAI() | |
api_key = os.getenv('OPENAI_API_KEY') | |
file = 'audio/german.mp3' | |
with open(file, 'rb') as audio_file: |
This file contains hidden or 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 os | |
from dotenv import load_dotenv | |
from openai import OpenAI | |
client = OpenAI() | |
api_key = os.getenv('OPENAI_API_KEY') | |
file = 'audio/rr.mp3' | |
with open(file, 'rb') as audio_file: |
This file contains hidden or 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
from openai import OpenAI | |
client = OpenAI() | |
import os | |
from dotenv import load_dotenv | |
api_key = os.getenv("OPENAI_API_KEY") | |
def get_chat_completion(user_prompt, system_role='You are a helpful assistant', | |
model='gpt-3.5-turbo', temperature=1): | |
messages = [ |
This file contains hidden or 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
from IPython.display import Image, display | |
image_path = 'images/triangle2.jpg' | |
display(Image(image_path, width=400)) | |
import base64 | |
def encode_image(image_path): | |
with open(image_path, 'rb') as image_file: | |
image_binary_data = image_file.read() | |
return base64.b64encode(image_binary_data).decode('utf-8') |
This file contains hidden or 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
from dotenv import load_dotenv | |
api_key = os.getenv("OPENAI_API_KEY") | |
from openai import OpenAI | |
client = OpenAI() | |
model = 'gpt-4o' | |
response = client.chat.completions.create( | |
model = model, |
NewerOlder