Spaces:
Sleeping
Sleeping
base_url_gone
Browse files- analyzer.py +0 -5
- app.py +1 -1
- chatbot_page.py +0 -2
- repo_explorer.py +0 -1
analyzer.py
CHANGED
|
@@ -16,7 +16,6 @@ def analyze_code(code: str) -> str:
|
|
| 16 |
"""
|
| 17 |
from openai import OpenAI
|
| 18 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 19 |
-
client.base_url = os.getenv("base_url")
|
| 20 |
system_prompt = (
|
| 21 |
"You are a highly precise and strict JSON generator. Analyze the code given to you. "
|
| 22 |
"Your ONLY output must be a valid JSON object with the following keys: 'strength', 'weaknesses', 'speciality', 'relevance rating'. "
|
|
@@ -236,7 +235,6 @@ def analyze_code_chunk(code: str, user_requirements: str = "") -> str:
|
|
| 236 |
"""
|
| 237 |
from openai import OpenAI
|
| 238 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 239 |
-
client.base_url = os.getenv("base_url")
|
| 240 |
|
| 241 |
# Build the user requirements section
|
| 242 |
requirements_section = ""
|
|
@@ -271,7 +269,6 @@ def aggregate_chunk_analyses(chunk_jsons: list, user_requirements: str = "") ->
|
|
| 271 |
"""
|
| 272 |
from openai import OpenAI
|
| 273 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 274 |
-
client.base_url = os.getenv("base_url")
|
| 275 |
|
| 276 |
# Build the user requirements section
|
| 277 |
requirements_section = ""
|
|
@@ -329,7 +326,6 @@ def analyze_repo_chunk_for_context(chunk: str, repo_id: str) -> str:
|
|
| 329 |
try:
|
| 330 |
from openai import OpenAI
|
| 331 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 332 |
-
client.base_url = os.getenv("base_url")
|
| 333 |
|
| 334 |
context_prompt = f"""You are analyzing a chunk of code from the repository '{repo_id}' to create a conversational summary for a chatbot assistant.
|
| 335 |
|
|
@@ -385,7 +381,6 @@ def create_repo_context_summary(repo_content: str, repo_id: str) -> str:
|
|
| 385 |
try:
|
| 386 |
from openai import OpenAI
|
| 387 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 388 |
-
client.base_url = os.getenv("base_url")
|
| 389 |
|
| 390 |
final_prompt = f"""Based on the following section summaries of repository '{repo_id}', create a comprehensive overview that a chatbot can use to answer user questions.
|
| 391 |
|
|
|
|
| 16 |
"""
|
| 17 |
from openai import OpenAI
|
| 18 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
|
|
|
| 19 |
system_prompt = (
|
| 20 |
"You are a highly precise and strict JSON generator. Analyze the code given to you. "
|
| 21 |
"Your ONLY output must be a valid JSON object with the following keys: 'strength', 'weaknesses', 'speciality', 'relevance rating'. "
|
|
|
|
| 235 |
"""
|
| 236 |
from openai import OpenAI
|
| 237 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
|
|
|
| 238 |
|
| 239 |
# Build the user requirements section
|
| 240 |
requirements_section = ""
|
|
|
|
| 269 |
"""
|
| 270 |
from openai import OpenAI
|
| 271 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
|
|
|
| 272 |
|
| 273 |
# Build the user requirements section
|
| 274 |
requirements_section = ""
|
|
|
|
| 326 |
try:
|
| 327 |
from openai import OpenAI
|
| 328 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
|
|
|
| 329 |
|
| 330 |
context_prompt = f"""You are analyzing a chunk of code from the repository '{repo_id}' to create a conversational summary for a chatbot assistant.
|
| 331 |
|
|
|
|
| 381 |
try:
|
| 382 |
from openai import OpenAI
|
| 383 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
|
|
|
| 384 |
|
| 385 |
final_prompt = f"""Based on the following section summaries of repository '{repo_id}', create a comprehensive overview that a chatbot can use to answer user questions.
|
| 386 |
|
app.py
CHANGED
|
@@ -125,7 +125,7 @@ Selected repositories:"""
|
|
| 125 |
try:
|
| 126 |
from openai import OpenAI
|
| 127 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 128 |
-
client.base_url = os.getenv("base_url")
|
| 129 |
|
| 130 |
response = client.chat.completions.create(
|
| 131 |
model="openai/gpt-4.1-nano",
|
|
|
|
| 125 |
try:
|
| 126 |
from openai import OpenAI
|
| 127 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 128 |
+
# client.base_url = os.getenv("base_url")
|
| 129 |
|
| 130 |
response = client.chat.completions.create(
|
| 131 |
model="openai/gpt-4.1-nano",
|
chatbot_page.py
CHANGED
|
@@ -18,7 +18,6 @@ conversation_history = []
|
|
| 18 |
def chat_with_user(user_message, history):
|
| 19 |
from openai import OpenAI
|
| 20 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 21 |
-
client.base_url = os.getenv("base_url")
|
| 22 |
# Build the message list for the LLM
|
| 23 |
messages = [
|
| 24 |
{"role": "system", "content": CHATBOT_SYSTEM_PROMPT}
|
|
@@ -41,7 +40,6 @@ def chat_with_user(user_message, history):
|
|
| 41 |
def extract_keywords_from_conversation(history):
|
| 42 |
from openai import OpenAI
|
| 43 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 44 |
-
client.base_url = os.getenv("base_url")
|
| 45 |
# Combine all user and assistant messages into a single string
|
| 46 |
conversation = "\n".join([f"User: {msg[0]}\nAssistant: {msg[1]}" for msg in history if msg[1]])
|
| 47 |
system_prompt = (
|
|
|
|
| 18 |
def chat_with_user(user_message, history):
|
| 19 |
from openai import OpenAI
|
| 20 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
|
|
|
| 21 |
# Build the message list for the LLM
|
| 22 |
messages = [
|
| 23 |
{"role": "system", "content": CHATBOT_SYSTEM_PROMPT}
|
|
|
|
| 40 |
def extract_keywords_from_conversation(history):
|
| 41 |
from openai import OpenAI
|
| 42 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
|
|
|
| 43 |
# Combine all user and assistant messages into a single string
|
| 44 |
conversation = "\n".join([f"User: {msg[0]}\nAssistant: {msg[1]}" for msg in history if msg[1]])
|
| 45 |
system_prompt = (
|
repo_explorer.py
CHANGED
|
@@ -276,7 +276,6 @@ Answer the user's question based on your comprehensive knowledge of this reposit
|
|
| 276 |
try:
|
| 277 |
from openai import OpenAI
|
| 278 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
| 279 |
-
client.base_url = os.getenv("base_url")
|
| 280 |
|
| 281 |
response = client.chat.completions.create(
|
| 282 |
model="openai/gpt-4.1-nano",
|
|
|
|
| 276 |
try:
|
| 277 |
from openai import OpenAI
|
| 278 |
client = OpenAI(api_key=os.getenv("OpenAI_API"))
|
|
|
|
| 279 |
|
| 280 |
response = client.chat.completions.create(
|
| 281 |
model="openai/gpt-4.1-nano",
|