Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
harishmohanraj committed Sep 25, 2024
1 parent 3aeb79b commit 0d8ccdd
Show file tree
Hide file tree
Showing 80 changed files with 7,109 additions and 347 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
from uuid import UUID

from asyncer import asyncify
from fastagency.studio.saas_app_generator import (
InvalidFlyTokenError,
InvalidGHTokenError,
SaasAppGenerator,
)
from fastapi import BackgroundTasks, HTTPException

from .auth_token.auth import create_deployment_auth_token
from .db.base import DefaultDB
from .models.base import Model, ObjectReference
from .models.registry import Registry
from .saas_app_generator import (
InvalidFlyTokenError,
InvalidGHTokenError,
SaasAppGenerator,
)

T = TypeVar("T", bound=Model)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from uuid import UUID

import autogen
from fastagency.api.openapi.client import OpenAPI
from fastagency.api.openapi import OpenAPI

from ..base import Field, Model
from ..registry import register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from asyncer import syncify
from autogen.agentchat import AssistantAgent as AutoGenAssistantAgent
from autogen.agentchat import ConversableAgent as AutoGenConversableAgent
from fastagency.studio.models.agents.web_surfer_autogen import WebSurferChat
from fastagency.runtime.autogen.tools import WebSurferTool
from typing_extensions import TypeAlias

from ..base import Field, Model
Expand Down Expand Up @@ -34,19 +34,19 @@ async def create_autogen(cls, model_id: UUID, user_id: UUID, **kwargs: Any) -> s


class WebSurferToolbox:
def __init__(self, websurfer_chat: WebSurferChat):
def __init__(self, websurfer_tool: WebSurferTool):
"""Create a toolbox for the web surfer agent. This toolbox will contain functions to delegate web surfing tasks to the internal web surfer agent.
Args:
websurfer_chat (WebSurferChat): The web surfer chat agent
websurfer_tool (WebSurferTool): The web surfer tool to be used in the toolbox
"""
self.websurfer_chat = websurfer_chat
self.websurfer_tool = websurfer_tool

def create_new_task(
task: Annotated[str, "task for websurfer"],
) -> str:
try:
return syncify(self.websurfer_chat.create_new_task)(task) # type: ignore [no-any-return]
return syncify(self.websurfer_tool.a_create_new_task)(task) # type: ignore [no-any-return]
except Exception as e:
raise e

Expand All @@ -62,7 +62,7 @@ def continue_task_with_additional_instructions(
) -> str:
try:
return syncify( # type: ignore [no-any-return]
self.websurfer_chat.continue_task_with_additional_instructions
self.websurfer_tool.a_continue_task_with_additional_instructions
)(message)
except Exception as e:
raise e
Expand Down Expand Up @@ -131,15 +131,15 @@ async def create_autogen(

viewport_size = websurfer_model.viewport_size

websurfer_chat = WebSurferChat(
websurfer_tool = WebSurferTool(
name_prefix=websurfer_model.name,
llm_config=llm_config,
summarizer_llm_config=summarizer_llm_config,
viewport_size=viewport_size,
bing_api_key=bing_api_key,
)

web_surfer_toolbox = WebSurferToolbox(websurfer_chat)
web_surfer_toolbox = WebSurferToolbox(websurfer_tool)

agent_name = websurfer_model.name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def create_reference_model(
__base__=ObjectReference,
)
reference_model.__module__ = (
f"fastagency.studio.models.{type_name}.{model_type_name}._generated"
f"fastagency_studio.models.{type_name}.{model_type_name}._generated"
)

reference_model._data_class = model_class # type: ignore[attr-defined]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
"Gemma-2 Instruct (9B)": "google/gemma-2-9b-it",
"Meta Llama 3 8B Instruct Reference": "meta-llama/Llama-3-8b-chat-hf",
"Meta Llama 3.1 70B Instruct Turbo": "albert/meta-llama-3-1-70b-instruct-turbo",
"Meta Llama 3.1 8B Instruct Turbo": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
"WizardLM-2 (8x22B)": "microsoft/WizardLM-2-8x22B",
"Mixtral-8x7B Instruct v0.1": "mistralai/Mixtral-8x7B-Instruct-v0.1",
"Meta Llama 3.1 405B Instruct Turbo": "meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
"Meta Llama 3 70B Instruct Reference": "meta-llama/Llama-3-70b-chat-hf",
"LLaVa-Next (Mistral-7B)": "llava-hf/llava-v1.6-mistral-7b-hf",
"DBRX Instruct": "databricks/dbrx-instruct",
"Nous Hermes 2 - Mixtral 8x7B-DPO ": "NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO",
"Meta Llama 3 8B Instruct Turbo": "meta-llama/Meta-Llama-3-8B-Instruct-Turbo",
"Meta Llama 3 8B Instruct Lite": "meta-llama/Meta-Llama-3-8B-Instruct-Lite",
"Meta Llama 3.1 8B Instruct": "meta-llama/Meta-Llama-3.1-8B-Instruct-Reference",
"Meta Llama 3.1 8B Instruct Turbo": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
"Mixtral-8x22B Instruct v0.1": "mistralai/Mixtral-8x22B-Instruct-v0.1",
"Gryphe MythoMax L2 Lite (13B)": "Gryphe/MythoMax-L2-13b-Lite",
"Hermes 3 - Llama-3.1 405B": "NousResearch/Hermes-3-Llama-3.1-405B-Turbo",
"LLaMA-2 Chat (7B)": "togethercomputer/llama-2-7b-chat",
"LLaVa-Next (Mistral-7B)": "llava-hf/llava-v1.6-mistral-7b-hf",
"WizardLM v1.2 (13B)": "WizardLM/WizardLM-13B-V1.2",
"Koala (7B)": "togethercomputer/Koala-7B",
"Qwen 2 Instruct (1.5B)": "Qwen/Qwen2-1.5B-Instruct",
Expand Down Expand Up @@ -96,6 +96,7 @@
"Meta Llama 3 70B Instruct": "meta-llama/Meta-Llama-3-70B-Instruct",
"Code Llama Instruct (70B)": "codellama/CodeLlama-70b-Instruct-hf",
"Hermes 2 Theta Llama-3 70B": "NousResearch/Hermes-2-Theta-Llama-3-70B",
"Test 11": "test/test11",
"Qwen 1.5 Chat (7B)": "Qwen/Qwen1.5-7B-Chat",
"Dolphin 2.5 Mixtral 8x7b": "cognitivecomputations/dolphin-2.5-mixtral-8x7b",
"LLaMA-2 Chat (70B)": "meta-llama/Llama-2-70b-chat-hf",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0d8ccdd

Please sign in to comment.