Skip to content
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

Add Agents client for invoking basic agent #233

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Conversation

epeters3
Copy link
Contributor

@epeters3 epeters3 commented Nov 15, 2024

Tom has a long-running notebook that invokes our basic LLM agent a bunch of times in sequence. It takes longer than an hour to run so his PHC token times out. This PR adds a new Agents client with an invoke_basic method. The client inherits from BaseClient which should give it automatic support for auto-refreshing the access token when needed.

Comment on lines +11 to +17
## [0.36.0] - 2024-11-15

### Added

- Added a new `phc.services.Agents` API client with an `invoke_basic` method for
invoking a basic multi-modal LLM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only actual change to this file. The rest is prettier.

Comment on lines +5 to +14
class Agents(BaseClient):
"""
Provides access to the PHC agents API, which allows you to call LLM-based agents.
"""

def invoke_basic(self, body: Union[str, List[Dict]]):
"""
Invokes a basic agent, which supports either a basic prompt string or a list of
messages which can include images as data urls.
"""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be a good idea to list in the docs the abac permission(s) required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good idea. I'll make a follow-up PR.

@epeters3 epeters3 merged commit 306d697 into master Nov 18, 2024
6 checks passed
@epeters3 epeters3 deleted the FLDM-474/agents-client branch November 18, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants