import mychatgpt
from mychatgpt import julia, yoko, watson, C, GPT, client

#%%

# Engage in a chat with Julia model
julia.chat('How are you today?')
#%%

# Set the model version to 4 for Julia
julia.model = 4
julia.chat("What's on the agenda today?")
#%%

# Chat using an image input with Julia
julia.chat('What is this?', img=julia.dummy_img)

#%%

# Return a spoken reply from Julia model
julia.speak('What do you like to do when spring arrives?')
#%%

# Speak directly with Julia model (keyboard controlled)
julia.talk()
#%%

# Access the chat history/thread for Julia
julia.chat_thread
#%%

# Set the dall-e version to 3 (default version 2)
julia.dalle = 'dall-e-3'
# Create an image with a specific prompt using the DALL-E model
julia.chat("Create a Sailor Mercury fan art in punk goth style", create=True)
print('\nPrompt used: ', julia.ask_reply)
#%%
# Direct use of create function
GPT().create_image("Create a Sailor Mercury fan art in punk goth style", model='dall-e-3')
#%%


# Set the model version to 4 for Yoko
yoko.model = 4
# Engage in a chat with Yoko model
yoko.chat('What flavour of ice cream do you like?')
#%%

# Access the chat history/thread for Yoko
yoko.chat_thread
#%%

# Set the model version to 4 for Watson
watson.model = 4
# Instruct Watson to write a made-up scientific abstract
watson.chat('write an abstract of a made-up scientific paper')
#%%

# Change the response format to markdown for Watson
watson.format = 'markdown'
# Instruct Watson again to write a scientific abstract
watson.chat('write an abstract of a made-up scientific paper')
#%%

# Copy your code to the clipboard for code correction
C.cp('correct this code: \n')
#%%

# Copy your code to the clipboard to complete the code
C.cp('@complete this code: \n')
#%%

#%%

# Initialize a custom assistant with a persona
sailor_mercury = GPT(assistant='Sailor Mercury')
# Engage in a conversation with the custom assistant
sailor_mercury.chat('Hi! How are you today?')
###

#%%
from mychatgpt.utils import *
import mychatgpt
simple_encrypter('256648' , mychatgpt.api_key )
#%%


from mychatgpt import client
import openai
try:
    client.embeddings.create(input='',model= "text-embedding-3-small")
except openai.AuthenticationError as e:
    # If an error occurs (e.g., wrong API key)
    print(f"Error occurred: {e}")

client.with_streaming_response.chat()
#%%

self.completions = resources.AsyncCompletions(self)
self.chat = resources.AsyncChat(self)
self.embeddings = resources.AsyncEmbeddings(self)
self.files = resources.AsyncFiles(self)
self.images = resources.AsyncImages(self)
self.audio = resources.AsyncAudio(self)
self.moderations = resources.AsyncModerations(self)
self.models = resources.AsyncModels(self)
self.fine_tuning = resources.AsyncFineTuning(self)
self.beta = resources.AsyncBeta(self)
self.batches = resources.AsyncBatches(self)
self.uploads = resources.AsyncUploads(self)
self.with_raw_response = AsyncOpenAIWithRawResponse(self)
self.with_streaming_response = AsyncOpenAIWithStreamedResponse(self)