|
|
|
@ -12,6 +12,7 @@ config_directory = os.path.expanduser("~/.config/fabric")
|
|
|
|
|
env_file = os.path.join(config_directory, ".env") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Standalone: |
|
|
|
|
def __init__(self, args, pattern="", env_file="~/.config/fabric/.env"): |
|
|
|
|
# Expand the tilde to the full path |
|
|
|
@ -30,6 +31,7 @@ class Standalone:
|
|
|
|
|
self.config_pattern_directory = config_directory |
|
|
|
|
self.pattern = pattern |
|
|
|
|
self.args = args |
|
|
|
|
self.model = args.model |
|
|
|
|
|
|
|
|
|
def streamMessage(self, input_data: str): |
|
|
|
|
wisdomFilePath = os.path.join( |
|
|
|
@ -51,7 +53,7 @@ class Standalone:
|
|
|
|
|
messages = [user_message] |
|
|
|
|
try: |
|
|
|
|
stream = self.client.chat.completions.create( |
|
|
|
|
model="gpt-4", |
|
|
|
|
model=self.model, |
|
|
|
|
messages=messages, |
|
|
|
|
temperature=0.0, |
|
|
|
|
top_p=1, |
|
|
|
@ -98,7 +100,7 @@ class Standalone:
|
|
|
|
|
messages = [user_message] |
|
|
|
|
try: |
|
|
|
|
response = self.client.chat.completions.create( |
|
|
|
|
model="gpt-4", |
|
|
|
|
model=self.model, |
|
|
|
|
messages=messages, |
|
|
|
|
temperature=0.0, |
|
|
|
|
top_p=1, |
|
|
|
@ -181,6 +183,28 @@ class Update:
|
|
|
|
|
self.progress_bar.close() # Ensure the progress bar is cleaned up properly |
|
|
|
|
else: |
|
|
|
|
print(f"Failed to fetch directory contents due to an HTTP error: {e}") |
|
|
|
|
def list_models(): |
|
|
|
|
AVAILABLE_MODELS = [ |
|
|
|
|
"gpt-4-0125-preview", |
|
|
|
|
"gpt-4-turbo-preview", |
|
|
|
|
"gpt-4-1106-preview", |
|
|
|
|
"gpt-4-vision-preview", |
|
|
|
|
"gpt-4", |
|
|
|
|
"gpt-4-0613", |
|
|
|
|
"gpt-4-32k", |
|
|
|
|
"gpt-4-32k-0613", |
|
|
|
|
"gpt-3.5-turbo-0125", |
|
|
|
|
"gpt-3.5-turbo", |
|
|
|
|
"gpt-3.5-turbo-1106", |
|
|
|
|
"gpt-3.5-turbo-instruct", |
|
|
|
|
"gpt-3.5-turbo-16k", |
|
|
|
|
"gpt-3.5-turbo-0613", |
|
|
|
|
"gpt-3.5-turbo-16k-0613" |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
print("Available models:") |
|
|
|
|
for model in AVAILABLE_MODELS: |
|
|
|
|
print(model) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Setup: |
|
|
|
|