Skip to content

Commit

Permalink
remove unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton-byte committed Mar 12, 2024
1 parent 3185153 commit b2cf51b
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 81 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions bot_example/bot_example/agents/shazam.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from neonize.proto.Neonize_pb2 import Message
from neonize.client import NewClient, MediaType
import magic
from neonize.utils.ffmpeg import FFmpeg
from thundra.agents import agent, tool, ExtendedTextMessage
from neonize.proto.def_pb2 import AudioMessage, VideoMessage
from thundra.agents import agent
from langchain.tools import tool
from neonize.proto.def_pb2 import AudioMessage, VideoMessage, ExtendedTextMessage
from thundra.utils import download_media, get_user_id
from thundra.storage.file import storage
import json
Expand Down
4 changes: 3 additions & 1 deletion bot_example/bot_example/agents/yt.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from pytube import YouTube, Search
from thundra.agents import agent, tool, ExtendedTextMessage
from thundra.agents import agent
from langchain.tools import tool
from neonize.utils.ffmpeg import FFmpeg
from thundra.utils import convert_size
from neonize.client import NewClient
from neonize.proto.Neonize_pb2 import Message
from neonize.proto.def_pb2 import ExtendedTextMessage
from pytube import Search, YouTube, Stream
import os
import tempfile
Expand Down
1 change: 0 additions & 1 deletion bot_example/bot_example/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from logging import NOTSET, DEBUG, getLogger
from pathlib import Path
from neonize.client import DeviceProps, NewClient
from neonize.events import MessageEv, ConnectedEv
Expand Down
2 changes: 1 addition & 1 deletion bot_example/thundra.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model_name = ""
api_version = ""

[openai.openai]
api_key = ""
api_key = "ya"
model = ""

[openai.agent]
Expand Down
24 changes: 4 additions & 20 deletions thundra/agents.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
from langchain.tools import tool, StructuredTool
from langchain.agents import initialize_agent
from langchain.chains import LLMChain
from langchain.prompts import PromptTemplate
from neonize.client import NewClient
from neonize.proto.Neonize_pb2 import Message
from neonize.proto.def_pb2 import (
ImageMessage,
Conversation,
ExtendedTextMessage,
VideoMessage,
StickerMessage,
)
from neonize.utils.enum import MediaType
from typing import Callable, Any, Literal, Type, Generator, Sequence, Optional

from typing import Callable, Any, Type, Generator, Sequence
from dataclasses import dataclass

from .core.graph import Graph
from .types import MessageType, TextMessageType, MediaMessageType
from io import BytesIO
from .utils import get_message_type, get_user_id, MediaTypeToMMS, log, download_media
from .storage.file import storage
from .core.memory import memory
from .core.llm import llm
import json
from .types import MessageType
from .utils import log


@dataclass
Expand Down
17 changes: 3 additions & 14 deletions thundra/chain.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
from langchain_community.tools.wolfram_alpha import WolframAlphaQueryRun
from langchain_community.utilities.wolfram_alpha import WolframAlphaAPIWrapper
from langchain.agents import (
initialize_agent,
create_json_chat_agent,
create_structured_chat_agent,
AgentExecutor,
)
from langchain.prompts.chat import ChatPromptTemplate
from langchain.agents import initialize_agent
from neonize.client import NewClient
from neonize.proto.Neonize_pb2 import Message
from .utils import ChainMessage, get_message_type
from .agents import agent, tool
from .utils import get_message_type
from .agents import agent
from .core.llm import llm
import os
# from .agents import Knowledge
# os.environ['wolfram_alpha_appid'] = "9YG4YH-JUT4XLVWQ8"


def execute_agent(memory, client: NewClient, message: Message):
Expand Down
20 changes: 1 addition & 19 deletions thundra/command.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
from __future__ import annotations
import os
import re
from neonize.utils.ffmpeg import tempfile
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
import time
from typing import (
Any,
Callable,
Generator,
Sequence,
List,
Optional,
Self,
Union,
TypeVar,
Type,
)

from .core.graph import Graph
from .config import config
from neonize.client import NewClient, JID
from neonize.client import NewClient
from neonize.proto.Neonize_pb2 import Message
from neonize.proto.def_pb2 import (
ImageMessage,
Conversation,
ListMessage,
Message as MessageProto,
VideoMessage,
DocumentMessage,
MessageContextInfo,
ExtendedTextMessage,
FutureProofMessage,
ContextInfo,
)
from .utils import ChainMessage, log
from .types import MessageType as IMessageType
from .config import config_toml
Expand Down
2 changes: 1 addition & 1 deletion thundra/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass
from typing import Optional, Dict
import tomllib, os
import tomllib
import tomli_w
from .utils import workdir

Expand Down
1 change: 0 additions & 1 deletion thundra/evaluater.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import sys
from typing import Optional
from .utils import workdir


def evaluate_module(root_path: Path, workspace: Optional[Path] = None):
Expand Down
5 changes: 1 addition & 4 deletions thundra/plugins.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from dataclasses import dataclass
from io import BytesIO
from os import path
from pathlib import Path
from pyoverload import overload, params, override
from typing import Any, Iterable, List, Literal, Optional, Self
from typing import Iterable, List, Literal, Self
import appdirs
import requests
import zipfile
import tomllib
import glob
import secrets

from .utils import workdir

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions thundra/templates/app/agents/shazam.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from neonize.proto.Neonize_pb2 import Message
from neonize.client import NewClient, MediaType
import magic
from neonize.utils.ffmpeg import FFmpeg
from thundra.agents import agent, tool, ExtendedTextMessage
from neonize.proto.def_pb2 import AudioMessage, VideoMessage
from thundra.agents import agent
from langchain.tools import tool
from neonize.proto.def_pb2 import AudioMessage, VideoMessage, ExtendedTextMessage
from thundra.utils import download_media, get_user_id
from thundra.storage.file import storage
import json
Expand Down
4 changes: 3 additions & 1 deletion thundra/templates/app/agents/yt.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from pytube import YouTube, Search
from thundra.agents import agent, tool, ExtendedTextMessage
from thundra.agents import agent
from langchain.tools import tool
from neonize.utils.ffmpeg import FFmpeg
from thundra.utils import convert_size
from neonize.client import NewClient
from neonize.proto.Neonize_pb2 import Message
from neonize.proto.def_pb2 import ExtendedTextMessage
from pytube import Search, YouTube, Stream
import os
import tempfile
Expand Down
1 change: 0 additions & 1 deletion thundra/templates/app/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from logging import NOTSET, DEBUG, getLogger
from pathlib import Path
from neonize.client import DeviceProps, NewClient
from neonize.events import MessageEv, ConnectedEv
Expand Down
2 changes: 0 additions & 2 deletions thundra/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from .utils import log
from logging import NOTSET, DEBUG
from .config import config_toml
import os

Expand Down
3 changes: 1 addition & 2 deletions thundra/types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import NewType, TypeVar, Union
from typing import Union
from neonize.proto.def_pb2 import (
ImageMessage,
Conversation,
VideoMessage,
DocumentMessage,
ExtendedTextMessage,
Expand Down
10 changes: 3 additions & 7 deletions thundra/utils.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
from logging import exception
import sys
import magic
from typing import Iterable, Literal, Optional, Self, Tuple, Type, TypeVar
from typing import Iterable, Optional, Type
from enum import Enum
from neonize import NewClient
from neonize.proto.def_pb2 import Conversation, ImageMessage, Message as MessageProto
from neonize.proto.def_pb2 import ImageMessage, Message as MessageProto
from neonize.proto.Neonize_pb2 import Message
from neonize.proto.def_pb2 import (
ExtendedTextMessage,
VideoMessage,
)
from .types import MessageType, MediaMessageType, TextMessageType
from .types import MessageType, MediaMessageType
from dataclasses import dataclass
from pathlib import Path
from logging import getLogger
import logging
import math
import os

Expand Down

0 comments on commit b2cf51b

Please sign in to comment.