Skip to content

Commit

Permalink
Modularizing everything; attacking ui_utils behemoth; fundamental rew…
Browse files Browse the repository at this point in the history
…rite starting with skills/tools; see Discord...
  • Loading branch information
jgravelle committed Jun 11, 2024
1 parent 8b22dcf commit aae764f
Show file tree
Hide file tree
Showing 24 changed files with 2,089 additions and 2,078 deletions.
1,884 changes: 1,017 additions & 867 deletions AutoGroq.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions AutoGroq/agent_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def construct_request(agent_name, description, user_request, user_input, rephras


def display_agents():
if "agents" in st.session_state and st.session_state.agents:
if "agents" in st.session_state and st.session_state.agents and len(st.session_state.agents) > 0:
st.sidebar.title("Your Agents")
st.sidebar.subheader("Click to interact")
display_agent_buttons(st.session_state.agents)
Expand Down Expand Up @@ -201,7 +201,7 @@ def process_agent_interaction(agent_index):
llm_provider = get_llm_provider(api_key=api_key)
llm_request_data = {
"model": st.session_state.model,
"temperature": st.session_state.get('temperature', 0.1),
"temperature": st.session_state.temperature,
"max_tokens": st.session_state.max_tokens,
"top_p": 1,
"stop": "TERMINATE",
Expand Down Expand Up @@ -245,7 +245,7 @@ def regenerate_agent_description(agent):
llm_provider = get_llm_provider(api_key=api_key)
llm_request_data = {
"model": st.session_state.model,
"temperature": st.session_state.get('temperature', 0.1),
"temperature": st.session_state.temperature,
"max_tokens": st.session_state.max_tokens,
"top_p": 1,
"stop": "TERMINATE",
Expand Down
6 changes: 4 additions & 2 deletions AutoGroq/cli/create_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import datetime
import json
import os
import streamlit as st
import sys

# Add the root directory to the Python module search path
Expand All @@ -11,8 +12,9 @@
from config import MODEL_TOKEN_LIMITS
from prompts import get_agent_prompt
from utils.api_utils import get_llm_provider
from utils.agent_utils import create_agent_data
from utils.auth_utils import get_api_key
from utils.file_utils import create_agent_data, sanitize_text
from utils.file_utils import sanitize_text

def create_agent(request, provider, model, temperature, max_tokens, output_file):
# Get the API key and provider
Expand All @@ -28,7 +30,7 @@ def create_agent(request, provider, model, temperature, max_tokens, output_file)
# Make the request to the LLM API
llm_request_data = {
"model": model,
"temperature": temperature,
"temperature": st.session_state.temperature,
"max_tokens": max_tokens,
"messages": [{"role": "user", "content": prompt}],
}
Expand Down
4 changes: 2 additions & 2 deletions AutoGroq/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@


# Database path
# AUTOGEN_DB_PATH="/path/to/custom/database.sqlite"
AUTOGEN_DB_PATH = os.environ.get('AUTOGEN_DB_PATH', default_db_path)
# FRAMEWORK_DB_PATH="/path/to/custom/database.sqlite"
FRAMEWORK_DB_PATH = os.environ.get('FRAMEWORK_DB_PATH', default_db_path)

MODEL_CHOICES = {
'default': None,
Expand Down
4 changes: 2 additions & 2 deletions AutoGroq/config_local.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ else:


# Database path
# AUTOGEN_DB_PATH="/path/to/custom/database.sqlite"
AUTOGEN_DB_PATH = os.environ.get('AUTOGEN_DB_PATH', default_db_path)
# FRAMEWORK_DB_PATH="/path/to/custom/database.sqlite"
FRAMEWORK_DB_PATH = os.environ.get('FRAMEWORK_DB_PATH', default_db_path)

MODEL_CHOICES = {
'default': None,
Expand Down
2 changes: 1 addition & 1 deletion AutoGroq/llm_providers/lmstudio_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def send_request(self, data):
lm_studio_request_data = {
"model": data["model"],
"messages": data["messages"],
"temperature": data.get("temperature", 0.1),
"temperature": st.session_state.temperature,
"max_tokens": data.get("max_tokens", 2048),
"stop": data.get("stop", "TERMINATE"),
}
Expand Down
2 changes: 1 addition & 1 deletion AutoGroq/llm_providers/ollama_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def send_request(self, data):
ollama_request_data = {
"model": data["model"],
"prompt": data["messages"][0]["content"],
"temperature": data.get("temperature", 0.1),
"temperature": st.session_state.temperature,
"max_tokens": data.get("max_tokens", 2048),
"stop": data.get("stop", "TERMINATE"),
"stream": False,
Expand Down
273 changes: 0 additions & 273 deletions AutoGroq/main.html

This file was deleted.

Loading

0 comments on commit aae764f

Please sign in to comment.