-
Notifications
You must be signed in to change notification settings - Fork 44.8k
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
feat(blocks): Add AI/ML API support to LLM blocks #9163
base: dev
Are you sure you want to change the base?
feat(blocks): Add AI/ML API support to LLM blocks #9163
Conversation
This PR targets the Automatically setting the base branch to |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
✅ Deploy Preview for auto-gpt-docs canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #9163 +/- ##
======================================
Coverage ? 33.94%
======================================
Files ? 16
Lines ? 1258
Branches ? 190
======================================
Hits ? 427
Misses ? 804
Partials ? 27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
✅ Deploy Preview for auto-gpt-docs-dev canceled.
|
@@ -35,6 +35,7 @@ | |||
ProviderName.OLLAMA, | |||
ProviderName.OPENAI, | |||
ProviderName.OPEN_ROUTER, | |||
ProviderName.AIML, |
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.
ProviderName.AIML, | |
ProviderName.AIML_API, |
same for all other occurrences
autogpt_platform/backend/backend/integrations/credentials_store.py
Outdated
Show resolved
Hide resolved
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.
Thanks for taking the effort to submit this integration!
A quick scan of your PR shows a couple of issues:
- Unrelated formatting changes in multiple files
- Changes in
classic/forge
- is this intentional? The addedAimlProvider
isn't used inautogpt_platform/backend/backend/blocks/llm.py
. The CI also fails because there are type issues in your added code inclassic/forge
.
CI should pass once you remove the changes in classic/forge
. Once you do this, and address the other comments, I'll take a look again. The changes in backend
look pretty good. :)
Also, please update and fulfill the checklist in the PR description.
Co-authored-by: Reinier van der Leer <[email protected]>
Co-authored-by: Reinier van der Leer <[email protected]>
…e.py Co-authored-by: Reinier van der Leer <[email protected]>
docs/content/classic/setup/index.md
Outdated
@@ -175,6 +175,19 @@ If you don't know which to choose, you can safely go with OpenAI*. | |||
[anthropic/models]: https://docs.anthropic.com/en/docs/models-overview | |||
|
|||
|
|||
### AI/ML API | |||
1. Make sure you have credits in your account: [Billing -> View Usage](https://aimlapi.com/app/billing?utm_source=autogpt&utm_medium=github&utm_campaign=integration) |
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 we remove all the utm's please
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.
hi!
We need the utms to evaluate the traffic from the project, and allocate the developer resources
(basically, I use them to prove to my team that open-source is important, and to grow our open-source integrators part of the team)
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.
Hey @OctavianTheI - happy to discuss this
I've booked a call with you guys tomorrow via your website.
@@ -4,6 +4,7 @@ | |||
# --8<-- [start:ProviderName] | |||
class ProviderName(str, Enum): | |||
ANTHROPIC = "anthropic" | |||
AIML_API = "aiml" |
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.
AIML_API = "aiml" | |
AIML_API = "aiml_api" |
@@ -433,6 +445,23 @@ def llm_call( | |||
response.usage.prompt_tokens if response.usage else 0, | |||
response.usage.completion_tokens if response.usage else 0, | |||
) | |||
elif provider == "aiml": |
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.
elif provider == "aiml": | |
elif provider == "aiml_api": |
@@ -49,6 +49,13 @@ | |||
title="Use Credits for OpenAI", | |||
expires_at=None, | |||
) | |||
aiml_credentials = APIKeyCredentials( |
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.
aiml_credentials = APIKeyCredentials( | |
aiml_api_credentials = APIKeyCredentials( |
@@ -49,6 +49,13 @@ | |||
title="Use Credits for OpenAI", | |||
expires_at=None, | |||
) | |||
aiml_credentials = APIKeyCredentials( | |||
id="aad82a89-9794-4ebb-977f-d736aa5260a3", | |||
provider="aiml", |
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.
provider="aiml", | |
provider="aiml_api", |
@@ -266,6 +266,7 @@ class Secrets(UpdateTrackingModel["Secrets"], BaseSettings): | |||
) | |||
|
|||
openai_api_key: str = Field(default="", description="OpenAI API key") | |||
aiml_api_key: str = Field(default="", description="AI/ML API key") |
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.
aiml_api_key: str = Field(default="", description="AI/ML API key") | |
aiml_api_key: str = Field(default="", description="'AI/ML API' key") |
@@ -103,6 +103,7 @@ export default function PrivatePage() { | |||
"6b9fc200-4726-4973-86c9-cd526f5ce5db", // Replicate | |||
"53c25cb8-e3ee-465c-a4d1-e75a4c899c2a", // OpenAI | |||
"24e5d942-d9e3-4798-8151-90143ee55629", // Anthropic | |||
"aad82a89-9794-4ebb-977f-d736aa5260a3", // AI/ML |
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.
"aad82a89-9794-4ebb-977f-d736aa5260a3", // AI/ML | |
"aad82a89-9794-4ebb-977f-d736aa5260a3", // AI/ML API |
@@ -52,6 +52,7 @@ export const providerIcons: Record< | |||
github: FaGithub, | |||
google: FaGoogle, | |||
groq: fallbackIcon, | |||
aiml: fallbackIcon, |
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.
aiml: fallbackIcon, | |
aiml_api: fallbackIcon, |
@@ -102,6 +102,7 @@ export type CredentialsType = "api_key" | "oauth2"; | |||
// --8<-- [start:BlockIOCredentialsSubSchema] | |||
export const PROVIDER_NAMES = { | |||
ANTHROPIC: "anthropic", | |||
AIML: "aiml", |
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.
AIML: "aiml", | |
AIML_API: "aiml_api", |
@@ -16,6 +16,7 @@ const CREDENTIALS_PROVIDER_NAMES = Object.values( | |||
|
|||
// --8<-- [start:CredentialsProviderNames] | |||
const providerDisplayNames: Record<CredentialsProviderName, string> = { | |||
aiml: "AI/ML", |
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.
aiml: "AI/ML", | |
aiml_api: "AI/ML API", |
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.
Please git reset --hard dev -- classic docs/content/classic
Changes 🏗️
Checklist 📋
For code changes:
max_tokens
parameter values and other configurations.Example test plan
For configuration changes:
.env.example
is updated or already compatible with my changesdocker-compose.yml
is updated or already compatible with my changesExamples of configuration changes