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

Issue Passing in Credential to VertexAI model #5279

Closed
2 of 14 tasks
jmho opened this issue May 26, 2023 · 0 comments · Fixed by #5297
Closed
2 of 14 tasks

Issue Passing in Credential to VertexAI model #5279

jmho opened this issue May 26, 2023 · 0 comments · Fixed by #5297

Comments

@jmho
Copy link

jmho commented May 26, 2023

System Info

langchain==0.0.180
google-cloud-aiplatform==1.25.0

Have Google Cloud CLI and ran and logged in using gcloud auth login

Running locally and online in Google Colab

Who can help?

@hwchase17 @hwchase17 @agola11

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

https://colab.research.google.com/drive/19QGMptiCn49fu4i5ZQ0ygfR74ktQFQlb?usp=sharing

Unexpected behaviorfield "credentials" not yet prepared so type is still a ForwardRef, you might need to call VertexAI.update_forward_refs(). seems to only appear if you pass in any credenitial valid or invalid to the vertexai wrapper from langchain.

The error

This code should not throw field "credentials" not yet prepared so type is still a ForwardRef, you might need to call VertexAI.update_forward_refs().. It should either not throw any errors, if the credentials, project_Id, and location are correct. Or, if there is an issue with one of params, it should throw a specific error from the vertexai.init call below but it doesn't seem to be reaching it if a credential is passed in.

vertexai.init(project=project_id,location=location,credentials=credentials,)
dev2049 pushed a commit that referenced this issue May 26, 2023
# Fixed passing creds to VertexAI LLM

Fixes  #5279 

It looks like we should drop a type annotation for Credentials.

Co-authored-by: Leonid Kuligin <[email protected]>
Undertone0809 pushed a commit to Undertone0809/langchain that referenced this issue Jun 19, 2023
# Fixed passing creds to VertexAI LLM

Fixes  langchain-ai#5279 

It looks like we should drop a type annotation for Credentials.

Co-authored-by: Leonid Kuligin <[email protected]>
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 a pull request may close this issue.

1 participant