Comments (5)
Hey Andy, thanks for letting me know. AI.js is still in active development and I'll look into getting Claude v2 working.
I haven't promoted AI.js much, but I should, I find it very helpful for my projects as well.
If you're able to produce an error, please let me know what you're seeing, otherwise I will aim to get an update out for Claude2 soon!
from ai.js.
Thanks for the awesome work!
It does work in CLI:
> ai the color of the sky is --service anthropic --model claude-2
I think the problem might be streaming though. Here the error I get when I change the model from GPT to claude (1 or 2).
I do get the same BTW when using it with claude-1
, so it probably is more of a streaming issue than a claude-2
one. Is that something that is supposed to work already in the library?
from ai.js.
@themaximal1st Hey there. Just wanted to check if you had a quick feedback on whether streaming is supposed to work for Claude (also v1) or if I should keep debugging on my end.
Thanks a lot! Have a wonderful day.
from ai.js.
from ai.js.
Thanks, I narrowed it down. Claude has no notion of a system message, which is why this did not work and cause the error mentioned above (which is not very descriptive unfortunately):
const messages = [
{ role: "system", content: "Give all answers in uppercase." },
{ role: "user", content: "Tell a one liner joke." },
];
const ai = new AI(messages, options);
const stream = await ai.send();
To make it work for both openai and anthropic, I just iterate the messages and change system roles to user. Like this is also works with claude-2
.
Thanks a lot for the help!
Maybe worth a note in the README or even better a test/check that informs the API user similar to when trying to use other unsupported features (like functions).
from ai.js.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ai.js.