-
Notifications
You must be signed in to change notification settings - Fork 1
Add agents to the python SDK #683
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
base: main
Are you sure you want to change the base?
Conversation
| ) | ||
| return AsyncAgent(self._client, agent_view.id) | ||
|
|
||
| def from_id(self, agent_id: str) -> AsyncAgent: |
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.
This is probably a missing thing in API but I think we probably want name in here as well?
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.
Not sure what is missing in the API?
In any case, a synchronous (and fully client-side) from_id() like this fits with BlueprintOps.from_id() and such, so this seems reasonable to pair with the AsyncAgent.get_info() call.
jrvb-rl
left a comment
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.
This seems fine as a start. Might be good to add some TODOs to decide about local caching.
| ) | ||
| return AsyncAgent(self._client, agent_view.id) | ||
|
|
||
| def from_id(self, agent_id: str) -> AsyncAgent: |
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.
Not sure what is missing in the API?
In any case, a synchronous (and fully client-side) from_id() like this fits with BlueprintOps.from_id() and such, so this seems reasonable to pair with the AsyncAgent.get_info() call.
| page = await self._client.agents.list( | ||
| **params, | ||
| ) |
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.
Question: does the list() call return just the IDs, or the ID + additional info?
| return await self._client.agents.retrieve( | ||
| self._id, | ||
| **options, | ||
| ) |
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'm wondering if we should cache the json response, so subsequent calls can return immediately? Also, if the list() call returns details instead of just IDs, we would want to return the deets we already have here.
One question on all of this, though: are agent objects on the server mutable? If so, then sticking with the "re-fetch every call" strategy may be better for now, since that way we don't need to worry about the local and server versions going out of sync. (Well, the user would need to worry about this in their code, but we would make no promises about it at this level...)
No description provided.