Skip to content

Instantly share code, notes, and snippets.

View Mocker's full-sized avatar

Ryan Mocker

View GitHub Profile
@hwchase17
hwchase17 / langchain_chat_gpt.py
Last active December 5, 2023 16:10
LangChain ChatGPT API Wrapper
from langchain.llms.base import LLM
from typing import Optional, List, Mapping, Any
import requests
from langchain.llms.utils import enforce_stop_tokens
class CustomLLM(LLM):
def __init__(self, url: str):
self.url = url