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
""" | |
While the origins of this are from a coding challenge I completed for fun (which I've done for years), I came up with this implementation all on my own after thinking for a while. Because of that, I'm quite proud of it. | |
I've also included the Python tests I wrote for it further below in this gist. | |
""" | |
### IMPLEMENTATION ### | |
import typing |
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 langchain.agents import AgentExecutor, create_openai_tools_agent | |
from langchain_openai import ChatOpenAI | |
from langchain.tools import tool | |
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder | |
from dotenv import load_dotenv | |
import os | |
load_dotenv() | |
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY") |
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
tracker = {} |
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
this._panResponder = PanResponder.create({ | |
// ----------- NEGOTIATION: | |
// A view can become the touch responder by implementing the correct negotiation methods. | |
// Should child views be prevented from becoming responder on first touch? | |
onStartShouldSetPanResponderCapture: (evt, gestureState) => () => { | |
console.info('onStartShouldSetPanResponderCapture'); | |
return true; | |
}, |
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
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6 { | |
font-family: 'GT America', sans-serif; | |
} | |
div, |
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
function outerLayer() { | |
const num = 10; | |
function innerLayer() { | |
return 4 * num + 5; | |
} | |
return innerLayer; | |
} | |
const closure = outerLayer(); | |
closure(); |