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

PaLM 2 API Integration #7356

Merged
merged 4 commits into from
Sep 21, 2023
Merged

Conversation

Mr-Destructive
Copy link
Contributor

@Mr-Destructive Mr-Destructive commented Sep 17, 2023

Description

Created a basic handler for PaLM API Integration into mindsdb.
It has the following set of features:

  • Generate Completion with a prompt
  • Generate Response with a given Prompt Template
  • Generate Embeddings for a given piece of text

Fixes #7319

Type of change

(Please delete options that are not relevant)

  • ⚑ New feature (non-breaking change which adds functionality)
  • πŸ“„ This change requires a documentation update

Verification Process

To ensure the changes are working as expected:

  • Test Location: Specify the URL or path for testing.
  • Verification Steps: Outline the steps or queries needed to validate the change. Include any data, configurations, or actions required to reproduce or see the new functionality.

Additional Media:

image

image

image

image

image

  • I have attached a brief loom video or screenshots showcasing the new functionality or change.

Checklist:

  • My code follows the style guidelines(PEP 8) of MindsDB.
  • I have appropriately commented on my code, especially in complex areas.
  • Necessary documentation updates are either made or tracked in issues.
  • Relevant unit and integration tests are updated or added.

I want to get feedback on the proposed way of this integration. I have used references from the OpenAI handler for this to get started. I am open to any suggestions or improvements you might have. Please let me know about the required changes and improvements.

Thank you. πŸ™

@dusvyat
Copy link
Contributor

dusvyat commented Sep 19, 2023

@Mr-Destructive Overall this looks great, thanks for your contribution.

One suggestion to make it even better would be to provide default args and create validation via a pydantic BaseModel class.

see the writer handler for an example of what I mean.

Specifically here and here

@Mr-Destructive
Copy link
Contributor Author

Have updated the integration with the pydantic BaseModel for the default args. Let me know of further changes if required.

user_column: str = None
assistant_column: str = None


Copy link
Contributor

@dusvyat dusvyat Sep 20, 2023

Choose a reason for hiding this comment

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

adding the following config class nested under your base model will prevent additional args being passed in query

class Config:
   extra = Extra.forbid

@dusvyat
Copy link
Contributor

dusvyat commented Sep 20, 2023

Have updated the integration with the pydantic BaseModel for the default args. Let me know of further changes if required.

@Mr-Destructive thanks for the quick changes, 2 minor comments then we are good to merge

Copy link
Contributor

@dusvyat dusvyat left a comment

Choose a reason for hiding this comment

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

thanks again, lgtm

@dusvyat dusvyat merged commit b0104da into mindsdb:staging Sep 21, 2023
5 of 6 checks passed
@dylanketterer dylanketterer mentioned this pull request Sep 22, 2023
@martyna-mindsdb
Copy link
Contributor

Please add a README file to the PaLM integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: merged
Development

Successfully merging this pull request may close these issues.

None yet

3 participants