Skip to content

Commit

Permalink
Fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
rusiaaman committed Jan 23, 2025
1 parent c0fd42f commit 94cb733
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
28 changes: 16 additions & 12 deletions src/wcgw_cli/anthropic_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@
from dotenv import load_dotenv
from typer import Typer

from src.wcgw.types_ import (
from wcgw.client.common import discard_input
from wcgw.client.memory import load_memory
from wcgw.client.tools import (
DoneFlag,
ImageData,
default_enc,
get_tool_output,
initialize,
which_tool_name,
)
from wcgw.types_ import (
BashCommand,
BashInteraction,
ContextSave,
Expand All @@ -36,16 +46,6 @@
ScreenShot,
WriteIfEmpty,
)
from src.wcgw.client.common import discard_input
from src.wcgw.client.memory import load_memory
from src.wcgw.client.tools import (
DoneFlag,
ImageData,
default_enc,
get_tool_output,
initialize,
which_tool_name,
)

History = list[MessageParam]

Expand Down Expand Up @@ -290,7 +290,11 @@ def loop(
mode="wcgw",
)

with open(os.path.join(os.path.dirname(__file__), "..", "wcgw", "client", "diff-instructions.txt")) as f:
with open(
os.path.join(
os.path.dirname(__file__), "..", "wcgw", "client", "diff-instructions.txt"
)
) as f:
system += f.read()

if history:
Expand Down
8 changes: 4 additions & 4 deletions src/wcgw_cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import importlib
from typing import Optional
from typer import Typer
import typer

from src.wcgw_cli.openai_client import loop as openai_loop
from src.wcgw_cli.anthropic_client import loop as claude_loop
import typer
from typer import Typer

from wcgw_cli.anthropic_client import loop as claude_loop
from wcgw_cli.openai_client import loop as openai_loop

app = Typer(pretty_exceptions_show_locals=False)

Expand Down
29 changes: 17 additions & 12 deletions src/wcgw_cli/openai_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@
from pydantic import BaseModel
from typer import Typer

from src.wcgw.types_ import (
from wcgw.client.common import CostData, History, Models, discard_input
from wcgw.client.memory import load_memory
from wcgw.client.tools import (
DoneFlag,
ImageData,
default_enc,
get_tool_output,
initialize,
which_tool,
)
from wcgw.types_ import (
BashCommand,
BashInteraction,
ContextSave,
Expand All @@ -33,17 +43,8 @@
ResetShell,
WriteIfEmpty,
)
from src.wcgw.client.common import CostData, History, Models, discard_input
from src.wcgw.client.memory import load_memory

from .openai_utils import get_input_cost, get_output_cost
from src.wcgw.client.tools import (
DoneFlag,
ImageData,
default_enc,
get_tool_output,
initialize,
which_tool,
)


class Config(BaseModel):
Expand Down Expand Up @@ -235,7 +236,11 @@ def loop(
mode="wcgw",
)

with open(os.path.join(os.path.dirname(__file__), "..", "wcgw", "client", "diff-instructions.txt")) as f:
with open(
os.path.join(
os.path.dirname(__file__), "..", "wcgw", "client", "diff-instructions.txt"
)
) as f:
system += f.read()

if not history:
Expand Down

0 comments on commit 94cb733

Please # to comment.