Skip to content

Commit

Permalink
implementing genAI using langchain future work
Browse files Browse the repository at this point in the history
  • Loading branch information
yours7himanshu committed Jan 14, 2025
1 parent b630f3b commit 9cd9f28
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions genAI/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.ipynb_checkpoints
venv
23 changes: 23 additions & 0 deletions genAI/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
from dotenv import load_dotenv
from langchain_google_vertexai import ChatVertexAI
from langchain_core.messages import HumanMessage, SystemMessage


load_dotenv();
gimini_api_key=os.getenv("GIMINI_API_KEY");
langchain_api_key = os.getenv("LANGCHAIN_API_KEY");

model = ChatVertexAI(model="gemini-1.5-flash")

# Define the conversation
messages = [
SystemMessage("Always there to help you"),
HumanMessage("hi!"),
]

# Invoke the model
response = model.invoke(messages)

# Print the response
print(response)

0 comments on commit 9cd9f28

Please sign in to comment.