Spaces:
Sleeping
Sleeping
Update art_explorer.py
Browse files- art_explorer.py +6 -3
art_explorer.py
CHANGED
@@ -1,11 +1,14 @@
|
|
1 |
from typing import Optional, List, Dict
|
2 |
import json
|
3 |
-
from
|
4 |
from .prompts import SYSTEM_PROMPT, format_exploration_prompt, DEFAULT_RESPONSE
|
5 |
|
6 |
class ExplorationPathGenerator:
|
7 |
def __init__(self, api_key: str):
|
8 |
-
self.client =
|
|
|
|
|
|
|
9 |
|
10 |
def generate_exploration_path(
|
11 |
self,
|
@@ -30,6 +33,7 @@ class ExplorationPathGenerator:
|
|
30 |
|
31 |
try:
|
32 |
response = self.client.chat.completions.create(
|
|
|
33 |
messages=[
|
34 |
{
|
35 |
"role": "system",
|
@@ -40,7 +44,6 @@ class ExplorationPathGenerator:
|
|
40 |
"content": formatted_prompt
|
41 |
}
|
42 |
],
|
43 |
-
model="mixtral-8x7b-32768", # or your preferred GROQ model
|
44 |
temperature=0.7,
|
45 |
max_tokens=2000
|
46 |
)
|
|
|
1 |
from typing import Optional, List, Dict
|
2 |
import json
|
3 |
+
from openai import OpenAI
|
4 |
from .prompts import SYSTEM_PROMPT, format_exploration_prompt, DEFAULT_RESPONSE
|
5 |
|
6 |
class ExplorationPathGenerator:
|
7 |
def __init__(self, api_key: str):
|
8 |
+
self.client = OpenAI(
|
9 |
+
base_url="https://api.groq.com/v1",
|
10 |
+
api_key=api_key
|
11 |
+
)
|
12 |
|
13 |
def generate_exploration_path(
|
14 |
self,
|
|
|
33 |
|
34 |
try:
|
35 |
response = self.client.chat.completions.create(
|
36 |
+
model="mixtral-8x7b-32768",
|
37 |
messages=[
|
38 |
{
|
39 |
"role": "system",
|
|
|
44 |
"content": formatted_prompt
|
45 |
}
|
46 |
],
|
|
|
47 |
temperature=0.7,
|
48 |
max_tokens=2000
|
49 |
)
|