Full Code of homanp/vercel-langchain for AI

main 9025bf531a8a cached
5 files
1.6 KB
627 tokens
1 symbols
1 requests
Download .txt
Repository: homanp/vercel-langchain
Branch: main
Commit: 9025bf531a8a
Files: 5
Total size: 1.6 KB

Directory structure:
gitextract_9eoj8xvl/

├── .gitignore
├── README.md
├── api/
│   └── index.py
├── requirements.txt
└── vercel.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.vercel
*.log
*.pyc
__pycache__

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/


================================================
FILE: README.md
================================================

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhomanp%2Fvercel-langchain)

# LangChain running on Vercel

A minimal example on how to run LangChain on Vercel using Flask.

## Installation

#### 1. Virtualenv
Create and activate `virtualenv`.

```bash
virtualenv MY_ENV
source MY_ENV/bin/activate
```

#### 2. Install requirements
```bash
pip install requirements.txt
```

#### 3. Start development server
```bash
vercel dev
```

#### 4. Example API route
```bash
GET http://localhost:3000
```

## Environment Variables

To run this project, you will need to add the following environment variables to your .env file

`OPENAI_API_KEY`

## One-Click Deploy

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhomanp%2Fvercel-langchain)



## Further reading

Learn more about how to use LangChain by visiting the offical documentation or repo:

https://langchain.readthedocs.io/en/latest/

https://github.com/hwchase17/langchain

================================================
FILE: api/index.py
================================================
import os

from flask import Flask
from langchain.llms import OpenAI

app = Flask(__name__)

@app.route('/')
def home():
    llm = OpenAI(temperature=0.9)
    text = "What would be a good company name a company that makes colorful socks?"

    return llm(text)


================================================
FILE: requirements.txt
================================================
Flask==2.2.2
langchain==0.0.113
openai==0.26.4


================================================
FILE: vercel.json
================================================
{
  "builds": [
    {
      "src": "api/index.py",
      "use": "@vercel/python"
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "api/index.py"
    }
  ]
}
Download .txt
gitextract_9eoj8xvl/

├── .gitignore
├── README.md
├── api/
│   └── index.py
├── requirements.txt
└── vercel.json
Download .txt
SYMBOL INDEX (1 symbols across 1 files)

FILE: api/index.py
  function home (line 9) | def home():
Condensed preview — 5 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2K chars).
[
  {
    "path": ".gitignore",
    "chars": 94,
    "preview": ".vercel\n*.log\n*.pyc\n__pycache__\n\n# Environments\n.env\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\n"
  },
  {
    "path": "README.md",
    "chars": 1073,
    "preview": "\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com"
  },
  {
    "path": "api/index.py",
    "chars": 261,
    "preview": "import os\n\nfrom flask import Flask\nfrom langchain.llms import OpenAI\n\napp = Flask(__name__)\n\n@app.route('/')\ndef home():"
  },
  {
    "path": "requirements.txt",
    "chars": 47,
    "preview": "Flask==2.2.2\nlangchain==0.0.113\nopenai==0.26.4\n"
  },
  {
    "path": "vercel.json",
    "chars": 174,
    "preview": "{\n  \"builds\": [\n    {\n      \"src\": \"api/index.py\",\n      \"use\": \"@vercel/python\"\n    }\n  ],\n  \"routes\": [\n    {\n      \"s"
  }
]

About this extraction

This page contains the full source code of the homanp/vercel-langchain GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 5 files (1.6 KB), approximately 627 tokens, and a symbol index with 1 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!