Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add claude-3.5-sonnet to ai assistant in code editor #1855

Merged
merged 25 commits into from
Sep 12, 2024
Merged

Conversation

AyushAgrawal-A2
Copy link
Collaborator

@AyushAgrawal-A2 AyushAgrawal-A2 commented Sep 7, 2024

requires adding anthropic api key to deployment, in quadratic-api env variables

ANTHROPIC_API_KEY=

Copy link

qa-wolf bot commented Sep 7, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Sep 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quadratic ✅ Ready (Inspect) Visit Preview Sep 12, 2024 5:05pm

@cla-bot cla-bot bot added the cla-signed label Sep 7, 2024
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1855 September 7, 2024 14:27 Inactive
Copy link

codecov bot commented Sep 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.92%. Comparing base (2d04e8b) to head (a9faf6e).
Report is 47 commits behind head on qa.

Additional details and impacted files
@@           Coverage Diff           @@
##               qa    #1855   +/-   ##
=======================================
  Coverage   90.92%   90.92%           
=======================================
  Files         208      208           
  Lines       43349    43349           
=======================================
  Hits        39415    39415           
  Misses       3934     3934           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidkircos
Copy link
Collaborator

Added to Heroku staging, and production.

It's worth noting that going forward all external APIs in every service should be optional for self hosting. If a user self-hosts and doesn't include an ANTHROPIC_API_KEY, it should be disabled in the app. Same with OPEN_AI and every other external service

@davidkircos
Copy link
Collaborator

Quick inital feedback.

The first time I used Claude in Python, it gave me Javascript code.

The margin between Avatar and the text is different.
CleanShot 2024-09-07 at 09 09 36@2x

@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1855 September 7, 2024 16:25 Inactive
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1855 September 7, 2024 16:33 Inactive
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1855 September 7, 2024 16:35 Inactive
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1855 September 7, 2024 17:28 Inactive
@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1855 September 7, 2024 17:31 Inactive
response.write(`data: ${JSON.stringify(chunk)}\n\n`);
}

response.write('[DONE]\n\n');
Copy link
Collaborator

@davidkircos davidkircos Sep 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why write [done] to the stream?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works without it, I think it was part of some old api
https://platform.openai.com/docs/api-reference/chat/create#chat-create-stream

[consoleOutput, editorContent, schemaJsonForAi, selectedCell.x, selectedCell.y, mode]
);

const cellContext = useMemo<AIMessage>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sent with every message?

Should we also add the editor content in addition to the console output?

Copy link
Collaborator Author

@AyushAgrawal-A2 AyushAgrawal-A2 Sep 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ai chat api is stateless, entire prompt history, including even quadratic docs is sent in every api request
editor content is already being sent here

@@ -249,6 +235,20 @@ ${QuadraticDocs}`,
<div id="ai-streaming-output-anchor" key="ai-streaming-output-anchor" />
</div>
</div>

<div className="flex flex-col items-end gap-2 px-3 pb-2">
<select
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1855 September 11, 2024 15:42 Inactive
@jimniels jimniels temporarily deployed to quadratic-api-dev-pr-1855 September 11, 2024 15:43 Inactive
@jimniels jimniels temporarily deployed to quadratic-api-dev-pr-1855 September 11, 2024 15:52 Inactive
@jimniels jimniels temporarily deployed to quadratic-api-dev-pr-1855 September 11, 2024 15:56 Inactive
Copy link
Collaborator

@davidkircos davidkircos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me! Really feels like a solid improvement in the right direction for AI in Quadratic.

@davidkircos davidkircos temporarily deployed to quadratic-api-dev-pr-1855 September 12, 2024 16:49 Inactive
@davidkircos davidkircos merged commit 2029614 into qa Sep 12, 2024
16 checks passed
@davidkircos davidkircos deleted the ayush/claude branch September 12, 2024 17:05
Copy link

qa-wolf bot commented Sep 12, 2024

E2E tests

QA 2 blocking bugs

Ran Status Preview Started Run time Est. dev time saved
71 workflows Done (Details) Sep 12, 2024 at 5:36 PM (UTC) 22 minutes ~32.33 hrs
✅ 61 passed

Preexisting bugs

2 Blocking bugs
If you are aware of any of these bugs, you can set their priority to low and prevent them from causing a run failure.
View all blocking bugs

1 Non-blocking bug

. . . . . . . .

Re-run your E2E tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants