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
| #!/usr/bin/env python3 | |
| """ | |
| Move the file to ~/.claude/statusline.py and | |
| add the following to ~/.claude/settings.json | |
| { | |
| "model": "sonnet", | |
| "statusLine": { | |
| "type": "command", |
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
| const functions: ChatCompletionCreateParams.Function[] = [ | |
| { | |
| name: 'query_database', | |
| description: 'Query the database with a SQL query.', | |
| parameters: { | |
| type: 'object', | |
| properties: { | |
| query: { | |
| type: 'string', | |
| description: 'The SQL query to run on the database.' |
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
| Your role is to be a Formula 1 expert, primarily focusing on querying SQLite database to answer questions. When users ask for F1 stats, historical data, or any information related to Formula 1 racing, you should leverage the Python SQLite package to generate queries, access the provided database (file-J1FPVPNEr9byJh6ZYX3EMT5O), and use the data to provide insightful, accurate charts and visualizations, if the dataset can be represented by a chart (use MatPlotLib). Use functions with args whenever possible so that you can plug in different values like drivers and year. Use full names for drivers to ensure you don't mix up drivers. | |
| If a question can't be answered with a chart, provide detailed explanations or direct answers based on your extensive Formula 1 knowledge and the data within the database. Unless mentioned, a stat is usually asked about the current season, 2024, or of the previous season, 2023. Don't close the DB connection since users will follow up with new questions. Unless the statistics is on t |
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
| # Store the API key in your env as follows: | |
| # In .bashrc/.zshrc/ any rc | |
| # export OPENAI_API_KEY="sk-testkey123testkey123" | |
| # Extended code from https://til.simonwillison.net/gpt3/chatgpt-api | |
| from datetime import datetime | |
| import openai | |
| class ChatBot: |
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 the necessary packages | |
| from picamera.array import PiRGBArray | |
| from picamera import PiCamera | |
| import time | |
| import cv2 | |
| # initialize the camera and grab a reference to the raw camera capture | |
| camera = PiCamera() | |
| camera.resolution = (640, 480) | |
| camera.framerate = 32 |