This file contains 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
# pylint: disable=too-few-public-methods,unused-argument,line-too-long,no-name-in-module | |
from typing import List | |
import logging | |
from pydantic import BaseModel, Field | |
from langchain.chat_models import ChatAnthropic | |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler | |
from langchain_decorators import llm_prompt, PromptTypes, GlobalSettings |
This file contains 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
Human: | |
<file path=setup.py> | |
import setuptools | |
with open("src/langchain_decorators/__init__.py", "rt") as f: | |
for line in f.readlines(): | |
if line.startswith("__version__"): | |
__version__ = line.split("=")[1].strip(" \n\"") |
This file contains 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 json | |
import time | |
from langchain.chat_models import ChatAnthropic | |
from langchain.schema import HumanMessage | |
FAST = "claude-instant-1" | |
GOOD = "claude-1.3" | |
model = GOOD |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# Credit to https://github.com/nsarrazin/serge - this is heavily copied from the API there and not very well yet but it might work.w | |
from typing import List, Optional | |
from uuid import UUID, uuid4 | |
from pydantic import BaseModel, Field | |
from datetime import datetime | |
import subprocess, os | |
import asyncio |
This file contains 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
A database of transactions between organisations was made with this SQL: | |
<code> | |
CREATE TABLE organisations ( id SERIAL PRIMARY KEY , name VARCHAR ( 255 ) NOT NULL ); | |
CREATE TABLE transactions ( id SERIAL PRIMARY KEY , amount INT NOT NULL , from_organisation_id INT NOT NULL REFERENCES organisations ( id ), to_organisation_id INT NOT NULL REFERENCES organisations ( id ) ); | |
INSERT INTO organisations ( name ) VALUES ( 'Acme' ), ( 'Widgets Inc' ), ( 'Foo Bar' ); | |
INSERT INTO transactions ( amount , from_organisation_id , to_organisation_id ) VALUES ( 100 , 1 , 2 ), ( 200 , 2 , 3 ), ( 300 , 3 , 1 ); | |
SELECT * FROM organisations ; |
This file contains 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
# A Flask server to echo HTTP request headers as JSON to investigate issues with a CORS proxy. | |
from flask import Flask, request, jsonify | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return jsonify(dict(request.headers)) |
This file contains 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 sys | |
import time | |
import json | |
import os | |
import hashlib | |
from PySide2.QtCore import * | |
from PySide2.QtGui import * | |
from PySide2.QtWidgets import ( | |
QApplication, | |
QTabWidget, |
This file contains 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
# xuuid.py | |
""" | |
xuuid 0.1.1 -- Extended Universally Unique Identifiers | |
Extremely large UUIDs that are: | |
more certainly unique, | |
descriptive, | |
supported by tooling for short local reference. | |
There is a distinction made between "hard" and "soft" data for an identifier. |
This file contains 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
// We already have a system that allows creating templates with empty placeholder sections for pages of sites as JSON. | |
// We need to take JSON that looks like this and turn it into editable real JSON Schema: | |
template = { | |
"name": "Great Example", | |
"domain": "great.example", | |
"websitemodel": [ | |
{ | |
"uuid": "44c2f597-79ef-49ed-9769-681f72f6b15e", | |
"name": "About and 404 pages", | |
"pagemodel": [ |