This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install build dependencies including Ninja | |
| !sudo apt-get update | |
| !sudo apt-get install -y build-essential cmake git ninja-build | |
| # Clone the repository | |
| !git clone https://github.com/ggerganov/llama.cpp | |
| %cd llama.cpp | |
| # Build with CUDA support using Ninja | |
| !cmake -B build -G Ninja \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from dotenv import load_dotenv | |
| from langchain.chat_models import init_chat_model | |
| from langgraph.prebuilt import create_react_agent | |
| from sqlalchemy import create_engine, text | |
| load_dotenv() | |
| engine = create_engine('sqlite:///sales.db') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from langchain.chat_models import init_chat_model | |
| from dotenv import load_dotenv | |
| from langchain_core.messages import HumanMessage, ToolMessage | |
| from langchain_core.tools import tool | |
| load_dotenv() | |
| llm = init_chat_model("gpt-4o-mini", model_provider="openai", api_key=os.getenv('OPENAI_API')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from dotenv import load_dotenv | |
| from langchain.chat_models import init_chat_model | |
| from langgraph.prebuilt import create_react_agent | |
| load_dotenv() | |
| def calculator(expression: str) -> str: | |
| """Evaluate a math expression""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from agents import Agent, Runner, function_tool | |
| import os | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| os.environ['OPENAI_API_KEY'] = os.getenv('OPENAI_API') | |
| @function_tool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from dotenv import load_dotenv | |
| from langchain.chat_models import init_chat_model | |
| from langchain_core.messages import HumanMessage, SystemMessage | |
| load_dotenv() | |
| model = init_chat_model( | |
| "gpt-4o-mini", | |
| model_provider="openai", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import json | |
| import requests | |
| from openai import OpenAI | |
| from dotenv import load_dotenv | |
| import matplotlib.pyplot as plt | |
| load_dotenv() | |
| client = OpenAI(api_key=os.getenv('OPENAI_API')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from dotenv import load_dotenv | |
| from openai import OpenAI | |
| from pydantic import BaseModel | |
| load_dotenv() | |
| client = OpenAI(api_key=os.getenv('OPENAI_API')) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import json | |
| import requests | |
| from openai import OpenAI | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| client = OpenAI(api_key=os.getenv('OPENAI_API')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import base64 | |
| from openai import OpenAI | |
| from dotenv import load_dotenv | |
| import fitz | |
| load_dotenv() | |
| client = OpenAI(api_key=os.getenv('OPENAI_API')) |
NewerOlder