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 {Controller} from "@hotwired/stimulus" | |
/* | |
* PermanentAttribute Controller | |
* | |
* This prevents Turbo morphing from updating certain attributes on an element. | |
* It is especially useful if you have changed a class on the browser in response | |
* to a UI event without sending this change to the server. The server does not | |
* know about this change and so will send the browser the original class on morphing, | |
* thereby clearing the state introduced by the original UI event. |
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
<html> | |
<title>Test</title> | |
<body> | |
This is a test. | |
<script> | |
// Create a new div | |
const div = document.createElement('div'); | |
// Set the div's text content to 'foo' |
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
"""A tool for running python code in a REPL.""" | |
import ast | |
from io import StringIO | |
import sys | |
from typing import Dict, Optional | |
from pydantic import Field, root_validator | |
from langchain.tools.base import BaseTool |
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
BASE_URL=https://app.agent-hq.io/api/v1 | |
API Documentation | |
------ | |
The API endpoint /agents/AGENT_ID/run is used to run an Agent or ask it a question | |
Here's an example of a POST to the /agents/AGENT_ID/run endpoint | |
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_API_KEY" -d '{ | |
"input": "what is my name?", |
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
BASE URL: https://api.open-meteo.com/ | |
API Documentation | |
The API endpoint /v1/forecast accepts a geographical coordinate, a list of weather variables and responds with a JSON hourly weather forecast for 7 days. Time always starts at 0:00 today and contains 168 hours. All URL parameters are listed below: | |
Parameter Format Required Default Description | |
latitude, longitude Floating point Yes Geographical WGS84 coordinate of the location | |
hourly String array No A list of weather variables which should be returned. Values can be comma separated, or multiple &hourly= parameter in the URL can be used. | |
daily String array No A list of daily weather variable aggregations which should be returned. Values can be comma separated, or multiple &daily= parameter in the URL can be used. If daily weather variables are specified, parameter timezone is required. | |
current_weather Bool No false Include current weather conditions in the JSON output. |
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
llm=OpenAI(temperature=0) | |
template = """ | |
Assistant is a large language model trained by OpenAI. | |
Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. | |
Assistant is constantly learning and improving, and its capabilities are constantly evolving. It is able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. Additionally, Assistant is able to generate its own text based on the input it receives, allowing it to engage in discussions and provide explanations and descriptions on a wide range of topics. | |
Overall, Assistant is a powerful tool that can help with a wide |
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
def prepare_prompt(params, user) | |
prompt = '"""' | |
prompt += "" "Person is named #{user.name}. " "" | |
prompt += "" " | |
Person has access to a Writing Assistant, which is a large language model trained by OpenAI. | |
Writing Assistant is designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, Writing Assistant is able to generate human-like text based on the input it receives, allowing it to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand. |
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 gpt_index import GPTSimpleVectorIndex, SimpleDirectoryReader, SimpleWebPageReader | |
from gpt_index.readers.schema.base import Document | |
import requests | |
import tempfile | |
import magic | |
import re | |
import html2text | |
def remote_url_loader(url, query): |
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
<a class="rcptr" href="http://www.rafflecopter.com/rafl/display/2faae12324/" rel="nofollow" data-raflid="2faae12324" data-theme="classic" data-template="" id="rcwidget_8vh5exmq">a Rafflecopter giveaway</a> | |
<script src="https://widget-prime.rafflecopter.com/launch.js"></script> |
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
<a class="rcptr" href="http://www.rafflecopter.com/rafl/display/2faae12321/" rel="nofollow" data-raflid="2faae12321" data-theme="classic" data-template="" id="rcwidget_n8bc9m2w">a Rafflecopter giveaway</a> | |
<script src="https://widget-prime.rafflecopter.com/launch.js"></script> |
NewerOlder