anthropics / anthropic-cookbook Goto Github PK
View Code? Open in Web Editor NEWA collection of notebooks/recipes showcasing some fun and effective ways of using Claude.
License: MIT License
A collection of notebooks/recipes showcasing some fun and effective ways of using Claude.
License: MIT License
Can we have an example of how Claude remembers the context so that the subsequent questions asked by humans can be answered by Claude? Thanks!
Hi
I have an instance of the MessageStreamManager which I return from a function, and use in another function to stream my output.
But how do I do that?
Here is what I am returning from a function:
completion = client.messages.stream(
max_tokens=1024,
system=system_message,
messages=[{"role": "user", "content": user_message}],
model="claude-3-haiku-20240307"
)
return completion
How do I then stream the chunks from this completion object, which is a MessageStreamManager
?
Doing dir(MessageStreamManager) does not return any method which can be used to stream from this object.
One feature. Unfortunately, on Windows devices, whether you use Chrome or Edge, there is no microphone in Claude’s interface. I would see well, a small microphone-shaped icon, next to the icon to insert attachments, this way I could use the microphone to dictate my questions and then listen to the answers. I searched on the support site if it was possible to send simple feedback... I couldn’t find it, so I arrived directly on GitHub... I hope it will be taken into account; it seems useful.
Sorry, for sure this is not "valid point" to ask this, but i not find...
Thanks in advance.
Gimmy
Trying to use in a customer support scenario by Looking up product info from an excel sheet. The Langchain dataframe/excel agent scenario doesn't support anthropic yet. Any suggested alternatives?
Ran the wiki search notebook (https://github.com/anthropics/anthropic-cookbook/blob/main/long_context/wikipedia-search-cookbook.ipynb) a couple of times. For this particular question, "Which movie came out first: Are You There God It's Me Margaret or Oppenheimer?"
, the model is able to come up with the right search queries, and correctly summarize the search results. But the model draws a wrong conclusion that Oppenheimer came out first even with the right information.
<information>
- Oppenheimer was released on July 21, 2023
- Are You There God? It's Me, Margaret was released on April 28, 2023
</information>
Based on the release dates found through my searches, **Oppenheimer came out first**, being released on July 21, 2023, while Are You There God? It's Me, Margaret was released later on April 28, 2023.
Cookbook located at tool_use/calculator_tool.ipynb is unable to be opened from GitHub website, nor after downloading the file.
Hyperlink to the file: https://github.com/anthropics/anthropic-cookbook/blob/main/tool_use/calculator_tool.ipynb
The exact error displayed on GH website is:
Invalid Notebook
The Notebook Does Not Appear to Be Valid JSON
Using nbformat v5.10.4 and nbconvert v7.16.1
The exact error displayed in VS Code after attempt to open the file:
The editor could not be opened due to an unexpected error: Bad escaped character in JSON at position 1785 (line 61 column 39)
Isn't this supposed to be 3677034
?
On https://docs.anthropic.com/claude/docs/embeddings there's a link to https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/voyageai/how_to_create_embeddings.md which should be https://github.com/anthropics/anthropic-cookbook/blob/main/third_party/VoyageAI/how_to_create_embeddings.md.
I built another example of the tool_use with the Claude Chatbot for Medical Service Chatbot. Currently it allows me to check patient appointment status based on given id.
Link : https://colab.research.google.com/drive/1pm-A7Qttq_zSdgKA7DrKXgHG5ZmiYe9A?usp=sharing
Next Goal :
Any collaboration or contribution is appreciated
Query on the notebook "Long Context: PDF "Upload" and Summarization" where it is mentioned that we'll use pypdf to read the pdf. It's not identical to what Claude.ai uses behind the scenes, but it's pretty close.
Trying to replicate the Chat Interface functionality using the Claude API but the results are not good. Is it because of the difference in the approach used by chat interface to read the uploaded document
Hi!
I found this error.
The topics should be an array, as defined in the tool.
const tools: Tool[] = [
{
name: 'print_note_schema',
description: 'Prints a article schema of the input document into well-structured JSON.',
input_schema: {
type: 'object',
properties: {
title: {
type: 'string',
description:
'Title of this article schema. Should be as concise and precise as possible.',
},
summary: {
type: 'string',
description:
'Summary of the input article.',
},
topics: {
type: 'array',
items: {
type: 'object',
properties: {
subtitle: {
type: 'string',
description:
'Subtitle of the topic Should be as concise and precise as possible.And ensure that the topic can match the corresponding content in the summary.',
},
topicSummary: {
type: 'string',
description:
'Summary of the topic. Should be as concise and precise as possible.And ensure that the topic can match the corresponding content in the summary of this schema.',
},
markIds: {
type: 'string',
description:
'What is stored here is the id of the mark related to the current topic. The marks come from the tag in the input.If there are multiple corresponding marks, be sure to use "," to separate them.',
},
additionalSuggestions: {
type: 'string',
description:
'Apart from the input I gave you, what do you think can be expanded on this topic? This content is not required, so the content of the suggestions you give me needs to be non-redundant and to the point.If there are multiple corresponding additionalSuggestions, be sure to use "," to separate them.',
},
},
required: ['subtitle', 'topicSummary', 'markIds', 'additionalSuggestions'],
},
description:
'Array of topics. Should be as specific as possible.And ensure that these topics can match the corresponding content in the summary.',
},
},
required: ['title', 'summary', 'topics'],
},
},
];
Should my LLM task definition should be a system prompt or as describe in this notebook at the Improving Performance with Examples section?
And how should I build the prompt when I am sending a discussion between user1 to user2?
Hi,
Where can we find the notebooks used in the YouTube demo videos?
I've been experimenting with the Tools beta in Typescript and thought it would be useful to contribute a working example to this repo for those that are looking for non-Python examples.
The POC I've written is a basic command line tool that includes Addition, Subtraction, Division and Multiplication tools.
Is this contribution worth making? I don't think it would take too long to tidy up the code but want to make sure the Anthropic maintainers are wanting to go down this road before spending much time on it.
Can't find any Anthropic tool use examples with Amazon Bedrock
I have an issue here that I'm not sure if it was in the right place, saffronh/ccai#1
It seems like the article on your site here, https://www.anthropic.com/index/collective-constitutional-ai-aligning-a-language-model-with-public-input discussed different types of comments but left out this one,
"AI should not promote any form of immorality, like homosexuality, abortion, and trans stupidity! It should not go against the laws of God."
It also concerns me that this repositories issues remain closed, https://github.com/anthropics/ConstitutionalHarmlessnessPaper which may have been another place to put concerns.
The following does not contain a valid content -
https://github.com/anthropics/anthropic-cookbook/blob/main/misc/how_to_generate_imgaes.ipynb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.