Coder Social home page Coder Social logo

anthropic-cookbook's People

Contributors

alexalbertt avatar ben-epstein avatar brchristian avatar carsonkahn-external avatar colt avatar davidhershey avatar dsetzer avatar eltociear avatar garvand avatar jamescalam avatar jenan-anthropic avatar jpvajda avatar korakot avatar mikez avatar ph-7 avatar ravi03071991 avatar richmondalake avatar stakats avatar stellardave avatar zack-anthropic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anthropic-cookbook's Issues

Chat Model - Remembering the context

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!

How to stream with MessageStreamManager?

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.

?New feature? - MIC

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

Claude is not able to understand "before" and "after"

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.

Something is wrong wit the calculator_tool.ipynb cookbook

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)

How does Claude.ai reads the document uploaded

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

When using tools to get a structured response, the returned array sometimes becomes a string.

Hi!
I found this error.
image
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'],
},
},
];

Add Tools Beta Example using Typescript SDK

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.

AI Safety Concerns

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."

https://www.anthropic.com/index/collective-constitutional-ai-aligning-a-language-model-with-public-input

It also concerns me that this repositories issues remain closed, https://github.com/anthropics/ConstitutionalHarmlessnessPaper which may have been another place to put concerns.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.