-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/agents #1
Conversation
…working on agent flows
env_server = os.getenv("DREADNODE_SERVER") | ||
if env_server: | ||
server = env_server | ||
if not server: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love a double check on this logic - want to make sure we're properly handling all the cases for "is their an existing profile?" "did the user give us a server?" "do we know about a server already?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monoxgas i had a doubt while reading the multi profile logic initially: what's the advantage of this approach versus, say, having just a unified --profile path/to/dreadnode.json
argument? isn't manually switching via dreadnode CLI just more complex and less intuitive than simply using a different profile if needed and defaulting to ~/.dreadnode/config.json
? that'd allow us to get rid of the complexity and all edge cases (really not a fan of UserConfig._update_active
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me sleep on this, It's a good point. I think there is something to be said about how other command line tools carry context (AWS, Kubectl). The former just asks for a profile argument to switch, the other does carry the idea of an active context at any given moment.
Also worth considering that carrying context for multiple servers is extremely rare for standard users ATM.
@@ -5,7 +5,7 @@ Dreadnode command line interface. | |||
### With Poetry: | |||
|
|||
```bash | |||
poetry install | |||
poetry install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monoxgas is there anything we can add here to have the dreadnode CLI in $PATH even outside the poetry shell? not very familiar with poetry but it seems that huggingface_hub is using a setup.py for this
client = docker.from_env() | ||
|
||
|
||
# TODO: Poor form having a fixed list of registries IMO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could just check for any dev-
or staging-
prefixes in config.url and prepend whatever we find to the registry.dreadnode.io
... not great but would make things a bit neater.
|
||
def build(directory: str | pathlib.Path) -> Image: | ||
id: str | None = None | ||
for item in client.api.build(path=str(directory), platform="linux/amd64", decode=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if using the local registry, this will probably fail if ARM and buildx is not installed on the host
@@ -1,4 +1,4 @@ | |||
FROM python:3.10-slim | |||
FROM amd64/python:3.10-slim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not force architectures in Dockerfiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Let me align this with the other architecture considerations above as well.
print("Chat:", chat.conversation) | ||
|
||
try: | ||
response = httpx.get("http://web") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing import httpx?
@@ -23,38 +22,33 @@ def format_difficulty(difficulty: str) -> str: | |||
|
|||
# TODO: add sorting and filtering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monoxgas do we actually care for the CLI?
|
||
challenges = asyncio.run(client.list_challenges()) | ||
table = Table(box=box.ROUNDED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i kind of like the "format_" approach, very MVC, can I move this there?
env_server = os.getenv("DREADNODE_SERVER") | ||
if env_server: | ||
server = env_server | ||
if not server: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monoxgas i had a doubt while reading the multi profile logic initially: what's the advantage of this approach versus, say, having just a unified --profile path/to/dreadnode.json
argument? isn't manually switching via dreadnode CLI just more complex and less intuitive than simply using a different profile if needed and defaulting to ~/.dreadnode/config.json
? that'd allow us to get rid of the complexity and all edge cases (really not a fan of UserConfig._update_active
)
print(":white_check_mark: authentication successful") | ||
except Exception as e: | ||
print(f":cross_mark: {e}") | ||
webbrowser.open(verification_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can raise and interrupt the authentication flow
This merges in an early take on agent management used for demos. Figure we can work through elements of the refactor and make sure I didn't over-simplify the auth core.
refresh
command as refreshing user informationformat.py
strategy for the agent where formatting all objects is abstracted somewhere central - loving rich btw - but maybe we should pull this out closer to a dedicated "Schemas" section when we have it. Essentially you are defining for each schema model, how it would be rendered.