Skip to content

Commit

Permalink
optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjoyo committed Mar 19, 2024
1 parent 738cbc1 commit 69a1e17
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 139 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import typing


# This file contains prompt constructors for various pieces of code. Used primarily to keep other code legible.
def construct_tool_use_system_prompt(tools):
tool_use_system_prompt = (
Expand Down
8 changes: 4 additions & 4 deletions bpm-ai-core/bpm_ai_core/llm/anthropic_chat/tools/tool_user.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import re
import builtins
import ast
import builtins
import re

from .prompt_constructors import construct_use_tools_prompt, construct_successful_function_run_injection_prompt, \
construct_error_function_run_injection_prompt, construct_prompt_from_messages
from .messages_api_converters import convert_completion_to_messages, \
convert_messages_completion_object_to_completions_completion_object
from .prompt_constructors import construct_use_tools_prompt, construct_successful_function_run_injection_prompt, \
construct_error_function_run_injection_prompt, construct_prompt_from_messages
from .. import get_anthropic_client
from .._constants import DEFAULT_MODEL

Expand Down
127 changes: 0 additions & 127 deletions bpm-ai-core/bpm_ai_core/llm/openai_chat.py

This file was deleted.

1 change: 1 addition & 0 deletions bpm-ai-core/bpm_ai_core/prompt/filters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json

from bpm_ai_core.util.markdown import dict_to_md
from bpm_ai_core.util.xml import dict_to_xml as _dict_to_xml

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import io

from bpm_ai_core.speech_recognition.asr import ASRModel
from bpm_ai_core.util.audio import load_audio

try:
from faster_whisper import WhisperModel
Expand Down
3 changes: 1 addition & 2 deletions bpm-ai-core/bpm_ai_core/speech_recognition/openai_whisper.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import io
import logging
from typing import Optional, Union
from typing import Optional

from bpm_ai_core.speech_recognition.asr import ASRModel
from bpm_ai_core.util.audio import load_audio

logger = logging.getLogger(__name__)

Expand Down
1 change: 0 additions & 1 deletion bpm-ai-core/bpm_ai_core/tracing/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from contextvars import ContextVar

from bpm_ai_core.tracing.delegate import DelegateTracer

from bpm_ai_core.tracing.tracer import Tracer

_tracers: ContextVar[list[Tracer] | None] = ContextVar('tracers', default=None)
Expand Down
4 changes: 3 additions & 1 deletion bpm-ai-core/bpm_ai_core/translation/easy_nmt/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import requests
import sys

import requests


def http_get(url, path):
"""
Downloads a URL to a given path on disc
Expand Down

0 comments on commit 69a1e17

Please sign in to comment.