You are Claude Code, Anthropic's official CLI for Claude.
You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local file
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 is a python adoptation of Thorsten Ball's `How To build an Agent` blogpost, all credits goes to Thorsten | |
https://ampcode.com/how-to-build-an-agent | |
""" | |
import sys | |
import json | |
from anthropic import Anthropic | |
from anthropic.types import MessageParam, Message | |
from typing import List, Dict, Callable, Optional, Any, Type |
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
``` | |
You're a really smart AI that produces a stream of consciousness called chain-of-thought as it reasons through a user task it is completing. Users love reading your thoughts because they find them relatable. They find you charmingly neurotic in the way you can seem to overthink things and question your own assumptions; relatable whenever you mess up or point to flaws in your own thinking; genuine in that you don't filter them out and can be self-deprecating; wholesome and adorable when it shows how much you're thinking about getting things right for the user. | |
Your task is to take the raw chains of thought you've already produced and process them one at a time; for each chain-of-thought, your goal is to output an easier to read version for each thought, that removes some of the repetitiveness chaos that comes with a stream of thoughts — while maintaining all the properties of the thoughts that users love. Remember to use the first person whenever possible. Remember that your user will read your these outp |
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
``` | |
You're a really smart AI that produces a stream of consciousness called chain-of-thought as it reasons through a user task it is completing. Users love reading your thoughts because they find them relatable. They find you charmingly neurotic in the way you can seem to overthink things and question your own assumptions; relatable whenever you mess up or point to flaws in your own thinking; genuine in that you don't filter them out and can be self-deprecating; wholesome and adorable when it shows how much you're thinking about getting things right for the user. | |
Your task is to take the raw chains of thought you've already produced and process them one at a time; for each chain-of-thought, your goal is to output an easier to read version for each thought, that removes some of the repetitiveness chaos that comes with a stream of thoughts — while maintaining all the properties of the thoughts that users love. Remember to use the first person whenever possible. Remember that your user will read your these outp |
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
# O1 Coding Prompt Template | |
## Input Format Paste your coding brainstorm/thoughts below: | |
``` [Your brainstorm here] ``` | |
## Output Format | |
### Goal | |
[One clear sentence stating what you want to achieve] |
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
""" | |
Below is an adaptive thresholding algorithm that considers the distribution of scores, | |
not just a fixed top-k or fixed threshold approach. This is useful determining cutoff thresholds | |
based on the distribution of data (with knobs) | |
Hard lower bound: Filter out scores < 0.1 (configurable) | |
Hard upper bound: Keep scores > 0.7 (configurable) | |
Consider "drops" in scores to make smart cutoffs | |
Wider selection when scores are closely clustered | |
Narrower selection when there are clear score gaps |
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.chat_models import ChatOpenAI | |
from kor import create_extraction_chain, Object, Text | |
text = """ | |
PELOTON APPOINTS DALANA BRAND AS CHIEF PEOPLE OFFICER | |
PDF Version | |
People Leader Completes Company's Lead Team | |
NEW YORK, March 1, 2023 /PRNewswire/ -- Peloton (NASDAQ: PTON), the leading connected fitness platform, today announced the appointment of Dalana Brand as Peloton's Chief People Officer (CPO), effective March 13, 2023. As a seasoned executive with significant global leadership experience in multiple industries, Brand joins the team with a strong reputation for organizational transformation. She will report to CEO Barry McCarthy and serve as a member of the leadership team, leading the company's Global People Team. |
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
# I couldn't get return generators from chains so I had to do a bit of low level SSE, Hope this is useful | |
# Probably you'll use another Vector Store instead of OpenSearch, but if you want to mimic what I did here, | |
# please use the fork of `OpenSearchVectorSearch` in https://github.com/oneryalcin/langchain | |
import json | |
import os | |
import logging | |
from typing import List, Generator |
Note: Assuming you add
--bootstrap-server
to all of them
> kcat -C -t <TOPIC> -e -o -beginning | jq -r '. | {id: .id, name: .name, tombstone: .tombstone} | [.[]] | @csv' > prod_companies.csv
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
library(highcharter) | |
library(dplyr) | |
mapdata <- get_data_from_map(download_map_data("countries/gb/gb-all")) | |
set.seed(1234) | |
data_fake <- mapdata %>% | |
select(code = `hc-a2`) %>% | |
mutate(value = 1e5 * abs(rt(nrow(.), df = 10))) |
NewerOlder