@ax-llm/ax 9.0.3 → 9.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +184 -0
- package/README.md +21 -8
- package/build/module/src/ai/anthropic/api.d.ts +10 -9
- package/build/module/src/ai/anthropic/api.js +12 -8
- package/build/module/src/ai/anthropic/api.js.map +1 -1
- package/build/module/src/ai/anthropic/info.js +12 -6
- package/build/module/src/ai/anthropic/info.js.map +1 -1
- package/build/module/src/ai/anthropic/types.d.ts +16 -15
- package/build/module/src/ai/anthropic/types.js +9 -8
- package/build/module/src/ai/anthropic/types.js.map +1 -1
- package/build/module/src/ai/azure-openai/api.d.ts +11 -10
- package/build/module/src/ai/azure-openai/api.js +11 -7
- package/build/module/src/ai/azure-openai/api.js.map +1 -1
- package/build/module/src/ai/cohere/api.d.ts +13 -12
- package/build/module/src/ai/cohere/api.js +17 -13
- package/build/module/src/ai/cohere/api.js.map +1 -1
- package/build/module/src/ai/cohere/info.js +9 -9
- package/build/module/src/ai/cohere/info.js.map +1 -1
- package/build/module/src/ai/cohere/types.d.ts +12 -12
- package/build/module/src/ai/cohere/types.js +14 -14
- package/build/module/src/ai/cohere/types.js.map +1 -1
- package/build/module/src/ai/deepseek/api.d.ts +9 -8
- package/build/module/src/ai/deepseek/api.js +13 -9
- package/build/module/src/ai/deepseek/api.js.map +1 -1
- package/build/module/src/ai/deepseek/info.js +3 -3
- package/build/module/src/ai/deepseek/info.js.map +1 -1
- package/build/module/src/ai/deepseek/types.d.ts +1 -1
- package/build/module/src/ai/deepseek/types.js +5 -5
- package/build/module/src/ai/deepseek/types.js.map +1 -1
- package/build/module/src/ai/google-gemini/api.d.ts +15 -14
- package/build/module/src/ai/google-gemini/api.js +27 -23
- package/build/module/src/ai/google-gemini/api.js.map +1 -1
- package/build/module/src/ai/google-gemini/info.d.ts +1 -1
- package/build/module/src/ai/google-gemini/info.js +5 -5
- package/build/module/src/ai/google-gemini/info.js.map +1 -1
- package/build/module/src/ai/google-gemini/types.d.ts +32 -32
- package/build/module/src/ai/google-gemini/types.js +25 -25
- package/build/module/src/ai/google-gemini/types.js.map +1 -1
- package/build/module/src/ai/groq/api.d.ts +8 -7
- package/build/module/src/ai/groq/api.js +12 -8
- package/build/module/src/ai/groq/api.js.map +1 -1
- package/build/module/src/ai/groq/types.d.ts +1 -1
- package/build/module/src/ai/groq/types.js +7 -7
- package/build/module/src/ai/groq/types.js.map +1 -1
- package/build/module/src/ai/huggingface/api.d.ts +10 -9
- package/build/module/src/ai/huggingface/api.js +14 -10
- package/build/module/src/ai/huggingface/api.js.map +1 -1
- package/build/module/src/ai/huggingface/types.d.ts +6 -6
- package/build/module/src/ai/huggingface/types.js +4 -4
- package/build/module/src/ai/huggingface/types.js.map +1 -1
- package/build/module/src/ai/index.d.ts +1 -13
- package/build/module/src/ai/index.js +1 -39
- package/build/module/src/ai/index.js.map +1 -1
- package/build/module/src/ai/mistral/api.d.ts +9 -8
- package/build/module/src/ai/mistral/api.js +14 -10
- package/build/module/src/ai/mistral/api.js.map +1 -1
- package/build/module/src/ai/mistral/info.js +6 -6
- package/build/module/src/ai/mistral/info.js.map +1 -1
- package/build/module/src/ai/mistral/types.d.ts +2 -2
- package/build/module/src/ai/mistral/types.js +12 -12
- package/build/module/src/ai/mistral/types.js.map +1 -1
- package/build/module/src/ai/ollama/api.d.ts +10 -9
- package/build/module/src/ai/ollama/api.js +10 -10
- package/build/module/src/ai/ollama/api.js.map +1 -1
- package/build/module/src/ai/openai/api.d.ts +15 -14
- package/build/module/src/ai/openai/api.js +23 -19
- package/build/module/src/ai/openai/api.js.map +1 -1
- package/build/module/src/ai/openai/info.js +8 -8
- package/build/module/src/ai/openai/info.js.map +1 -1
- package/build/module/src/ai/openai/types.d.ts +17 -17
- package/build/module/src/ai/openai/types.js +17 -17
- package/build/module/src/ai/openai/types.js.map +1 -1
- package/build/module/src/ai/together/api.d.ts +8 -7
- package/build/module/src/ai/together/api.js +9 -5
- package/build/module/src/ai/together/api.js.map +1 -1
- package/build/module/src/ai/types.d.ts +2 -2
- package/build/module/src/ai/wrap.d.ts +47 -0
- package/build/module/src/ai/wrap.js +95 -0
- package/build/module/src/ai/wrap.js.map +1 -0
- package/build/module/src/db/base.d.ts +7 -7
- package/build/module/src/db/base.js +1 -1
- package/build/module/src/db/cloudflare.d.ts +9 -9
- package/build/module/src/db/cloudflare.js +2 -2
- package/build/module/src/db/cloudflare.js.map +1 -1
- package/build/module/src/db/index.d.ts +1 -6
- package/build/module/src/db/index.js +1 -17
- package/build/module/src/db/index.js.map +1 -1
- package/build/module/src/db/memory.d.ts +9 -9
- package/build/module/src/db/memory.js +2 -2
- package/build/module/src/db/memory.js.map +1 -1
- package/build/module/src/db/pinecone.d.ts +9 -9
- package/build/module/src/db/pinecone.js +2 -2
- package/build/module/src/db/pinecone.js.map +1 -1
- package/build/module/src/db/weaviate.d.ts +9 -9
- package/build/module/src/db/weaviate.js +2 -2
- package/build/module/src/db/weaviate.js.map +1 -1
- package/build/module/src/db/wrap.d.ts +13 -0
- package/build/module/src/db/wrap.js +35 -0
- package/build/module/src/db/wrap.js.map +1 -0
- package/build/module/src/dsp/generate.js +8 -2
- package/build/module/src/dsp/generate.js.map +1 -1
- package/build/module/src/dsp/program.d.ts +1 -0
- package/build/module/src/dsp/program.js.map +1 -1
- package/build/module/src/dsp/router.js +2 -2
- package/build/module/src/examples/agent.js +3 -2
- package/build/module/src/examples/agent.js.map +1 -1
- package/build/module/src/examples/balancer.d.ts +1 -0
- package/build/module/src/examples/balancer.js +26 -0
- package/build/module/src/examples/balancer.js.map +1 -0
- package/build/module/src/examples/chain-of-thought.js +3 -2
- package/build/module/src/examples/chain-of-thought.js.map +1 -1
- package/build/module/src/examples/customer-support.js +3 -2
- package/build/module/src/examples/customer-support.js.map +1 -1
- package/build/module/src/examples/fibonacci.js +3 -2
- package/build/module/src/examples/fibonacci.js.map +1 -1
- package/build/module/src/examples/food-search.js +3 -2
- package/build/module/src/examples/food-search.js.map +1 -1
- package/build/module/src/examples/marketing.js +3 -2
- package/build/module/src/examples/marketing.js.map +1 -1
- package/build/module/src/examples/multi-modal.js +4 -3
- package/build/module/src/examples/multi-modal.js.map +1 -1
- package/build/module/src/examples/qna-tune.js +3 -2
- package/build/module/src/examples/qna-tune.js.map +1 -1
- package/build/module/src/examples/qna-use-tuned.js +3 -2
- package/build/module/src/examples/qna-use-tuned.js.map +1 -1
- package/build/module/src/examples/rag-docs.js +4 -3
- package/build/module/src/examples/rag-docs.js.map +1 -1
- package/build/module/src/examples/rag.js +3 -2
- package/build/module/src/examples/rag.js.map +1 -1
- package/build/module/src/examples/react.js +3 -2
- package/build/module/src/examples/react.js.map +1 -1
- package/build/module/src/examples/routing.js +3 -2
- package/build/module/src/examples/routing.js.map +1 -1
- package/build/module/src/examples/smart-home.js +3 -2
- package/build/module/src/examples/smart-home.js.map +1 -1
- package/build/module/src/examples/streaming1.js +8 -6
- package/build/module/src/examples/streaming1.js.map +1 -1
- package/build/module/src/examples/streaming2.js +7 -5
- package/build/module/src/examples/streaming2.js.map +1 -1
- package/build/module/src/examples/summarize.js +6 -4
- package/build/module/src/examples/summarize.js.map +1 -1
- package/build/module/src/examples/vectordb.js +4 -4
- package/build/module/src/examples/vectordb.js.map +1 -1
- package/build/module/src/prompts/prompts.test.js +7 -3
- package/build/module/src/prompts/prompts.test.js.map +1 -1
- package/package.json +7 -5
- package/build/module/src/text/functions.d.ts +0 -8
- package/build/module/src/text/functions.js +0 -55
- package/build/module/src/text/functions.js.map +0 -1
- package/build/module/src/text/index.d.ts +0 -3
- package/build/module/src/text/index.js +0 -4
- package/build/module/src/text/index.js.map +0 -1
- package/build/module/src/text/jsonschema.d.ts +0 -1
- package/build/module/src/text/jsonschema.js +0 -96
- package/build/module/src/text/jsonschema.js.map +0 -1
- package/build/module/src/text/memory.d.ts +0 -21
- package/build/module/src/text/memory.js +0 -73
- package/build/module/src/text/memory.js.map +0 -1
- package/build/module/src/text/types.d.ts +0 -57
- package/build/module/src/text/types.js +0 -2
- package/build/module/src/text/types.js.map +0 -1
- package/build/module/src/types/index.d.ts +0 -51
- package/build/module/src/types/index.js +0 -2
- package/build/module/src/types/index.js.map +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
## 9.1.0 (2024-06-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add anthropic claude llms ([1e09f67](https://github.com/ax-llm/ax/commit/1e09f6720f34aa8025a37410df45c0cdedcfec49))
|
|
11
|
+
* add api rate-limiter support ([e4a8863](https://github.com/ax-llm/ax/commit/e4a8863e8fbbe3b7123737493bbb5c786eb51d96))
|
|
12
|
+
* add azure openai ([4478ed1](https://github.com/ax-llm/ax/commit/4478ed12c23abba3e935e84d37550a401f4562fb))
|
|
13
|
+
* add built-in function for embeddings ([37dfa99](https://github.com/ax-llm/ax/commit/37dfa99cb67eb36fabce79273727a3f201a3aa0b))
|
|
14
|
+
* add busines information extraction prompt ([cb2dca5](https://github.com/ax-llm/ax/commit/cb2dca5b34ffda2c0d03b45ac4c2c9d240615cc1))
|
|
15
|
+
* add caching proxy ([ba57bf9](https://github.com/ax-llm/ax/commit/ba57bf9417a74b719daa795afcd501235da1d3af))
|
|
16
|
+
* add caching proxy ([335dcbd](https://github.com/ax-llm/ax/commit/335dcbdbc4311784d095cc6be66b57d2a0d5909c))
|
|
17
|
+
* add google gemini safety controls ([7783bbe](https://github.com/ax-llm/ax/commit/7783bbee545d13a7b9f8a899d64ec2e59d1c931f))
|
|
18
|
+
* add google palm models ([cf6bf11](https://github.com/ax-llm/ax/commit/cf6bf11e30dee95d0799e6d19baa573a2a9765b9))
|
|
19
|
+
* add gpt-4 support ([405b87e](https://github.com/ax-llm/ax/commit/405b87e60fbb5942646e013c3a56fbc13d120c24))
|
|
20
|
+
* add ollama ([c1181e0](https://github.com/ax-llm/ax/commit/c1181e02e775f218a928dfdd0013d306c8e19106))
|
|
21
|
+
* add semantic router ([2096158](https://github.com/ax-llm/ax/commit/209615831a9f814bc10071280857d2b4f51c2a3a))
|
|
22
|
+
* add streaming support for gemini and cohere ([a946d52](https://github.com/ax-llm/ax/commit/a946d521f01267208ca863b0fd52b1f1d91d6929))
|
|
23
|
+
* add streaming support to proxy ([5edd33c](https://github.com/ax-llm/ax/commit/5edd33c1905a00a6fb1f05f395090e569ea954e5))
|
|
24
|
+
* add support for embeddings to use with vector search ([4bd4ba4](https://github.com/ax-llm/ax/commit/4bd4ba4cb9d3edd1dabea3ec8b3c3201b06b18da))
|
|
25
|
+
* add support for json type and other fixes ([3249746](https://github.com/ax-llm/ax/commit/32497461524b6138bf0c6142f71fe1d5b96386a2))
|
|
26
|
+
* add together compute llm api support ([37fc9cf](https://github.com/ax-llm/ax/commit/37fc9cf27e0b75e0068e7b58956b784ead6934cf))
|
|
27
|
+
* add vector db and embeddings example ([141ad9f](https://github.com/ax-llm/ax/commit/141ad9f1dd4d4f19c8ef07b362c57cb628f42e37))
|
|
28
|
+
* added a new llm alephalpha ([bff5f51](https://github.com/ax-llm/ax/commit/bff5f51812bcf22a8f6c89e58c98866208f14e1a))
|
|
29
|
+
* added agent tracing ([4bc9ae7](https://github.com/ax-llm/ax/commit/4bc9ae7ca5e02f194a23ed73b3aa8dcbbda43e4a))
|
|
30
|
+
* added claude3, gemini and fixed openai azure ([1c902d1](https://github.com/ax-llm/ax/commit/1c902d102fc8bce226c7c29bdafdb6e98b4ce170))
|
|
31
|
+
* added dsp ([fc9c292](https://github.com/ax-llm/ax/commit/fc9c292838fd7cdbb9e36633d7ad847206349c64))
|
|
32
|
+
* added in memory vector db with serialize to disk ([5036933](https://github.com/ax-llm/ax/commit/50369334388332ee9414b80b92835ab3915e786e))
|
|
33
|
+
* added mistral support ([67747a0](https://github.com/ax-llm/ax/commit/67747a0dd0840e429fda5c9c98f36fce125133e5))
|
|
34
|
+
* added more tests ([fe33451](https://github.com/ax-llm/ax/commit/fe33451711c9870144cafa8e242fa05fc3152f09))
|
|
35
|
+
* added multi-modal support to anthropic api and other fixes ([95a0680](https://github.com/ax-llm/ax/commit/95a0680ec61d8d9803c6cea0b2732abebf046461))
|
|
36
|
+
* added openai chat-gpt api support ([eb4b151](https://github.com/ax-llm/ax/commit/eb4b151c160bb33560c2072240e4770572b4f0ff))
|
|
37
|
+
* added prefix Ax across type namespace ([3a9daf0](https://github.com/ax-llm/ax/commit/3a9daf0e45de834fc7b8719c2908f1b90800e0e2))
|
|
38
|
+
* added proxy bin ([65adabe](https://github.com/ax-llm/ax/commit/65adabe6de137a886a3055d6f9ea32f2304635e1))
|
|
39
|
+
* added the dsp style bootstrap few stop optimizer ([eab69c8](https://github.com/ax-llm/ax/commit/eab69c811c510235fe28377c83db662b15489909))
|
|
40
|
+
* agent framework, agents can use other agents ([93cbfb3](https://github.com/ax-llm/ax/commit/93cbfb3912e13e7e353ae70311be4467a2c97568))
|
|
41
|
+
* agent framework, agents can use other agents ([a7420e7](https://github.com/ax-llm/ax/commit/a7420e7256bf12667449c96a35d84c1a0f66d2ef))
|
|
42
|
+
* ai balancer to pick the cheapest llm with automatic fallback ([a8f7b7b](https://github.com/ax-llm/ax/commit/a8f7b7b9772691056d94a5cfec4d94f064df4a8f))
|
|
43
|
+
* auto-fix json syntax errors ([dc27812](https://github.com/ax-llm/ax/commit/dc27812ec9c9521dcc38d526e23191e9466e7d4e))
|
|
44
|
+
* automatic long term memory ([e94ffd5](https://github.com/ax-llm/ax/commit/e94ffd50d910ff6b17c25e7131ee87c38b2eba56))
|
|
45
|
+
* automatic vectordb retrieval augmented generation in proxy ([d081c18](https://github.com/ax-llm/ax/commit/d081c189f4cb78a217f7cfeeb127f528153a8813))
|
|
46
|
+
* aws bedrock support ([acdc89b](https://github.com/ax-llm/ax/commit/acdc89b49c733b6a31bb5e17694c6abe28d324eb))
|
|
47
|
+
* big [breaking] refactor ([c97395d](https://github.com/ax-llm/ax/commit/c97395d6d7ea5e259151675c19b0cb2f21e0c2a2))
|
|
48
|
+
* convert any document format to text and a full RAG engine builtin ([7f3f28c](https://github.com/ax-llm/ax/commit/7f3f28c0c185506fc479bfd61c1f35588e65cfd6))
|
|
49
|
+
* dbmanager handles chunking, embedding and search for text ([5c125f8](https://github.com/ax-llm/ax/commit/5c125f87d54fba405407bc4085701ffbf4748a45))
|
|
50
|
+
* deepseek and cohere function calling ([5341700](https://github.com/ax-llm/ax/commit/5341700a39b80115e9bce50b0176a1c9760a6064))
|
|
51
|
+
* enable remote logging with LLMC_APIKEY env var ([e04b257](https://github.com/ax-llm/ax/commit/e04b25797676bced2ecdc10c7368983d54ca2e19))
|
|
52
|
+
* gpt-4o added ([a388219](https://github.com/ax-llm/ax/commit/a388219ec52cfcef132199453f55ecb7c489156e))
|
|
53
|
+
* huggingface data loader ([47c6c0e](https://github.com/ax-llm/ax/commit/47c6c0efcfa468466dc54af2c92cc970821d30e2))
|
|
54
|
+
* improve trace logging ([12776be](https://github.com/ax-llm/ax/commit/12776be18d2d4795a018ff3e2bf710288586b589))
|
|
55
|
+
* improved debug logs ([38e869e](https://github.com/ax-llm/ax/commit/38e869e1be07ca7a0193bbb908819bd6759b561a))
|
|
56
|
+
* include reasoning in tracing ([e11f665](https://github.com/ax-llm/ax/commit/e11f665626ab34f462c73e7e05dd74db7b27d1fd))
|
|
57
|
+
* iterate to completion if max token length reached ([f9d0f50](https://github.com/ax-llm/ax/commit/f9d0f508609355dd93090e0021b73693733f3a52))
|
|
58
|
+
* JS code interpreter function ([b3de309](https://github.com/ax-llm/ax/commit/b3de30939e1f1f91e59c851d2a9f9600ca4ebed9))
|
|
59
|
+
* library is now down to 1 single dependency ([efaaa03](https://github.com/ax-llm/ax/commit/efaaa0338dbd8d2e8f272c7965bf5afb999e4276))
|
|
60
|
+
* llm converts meeting notes to trello tasks example ([633cb95](https://github.com/ax-llm/ax/commit/633cb956e3c04cced5006d2b32198dd3b42e13db))
|
|
61
|
+
* lots of api improvements and many bug fixes ([036cd06](https://github.com/ax-llm/ax/commit/036cd0662b80b3ef8e5e4994d00746ac74024a0b))
|
|
62
|
+
* major refactor to enable traceing and usage tracking ([a7c980c](https://github.com/ax-llm/ax/commit/a7c980cb3f2e50ca1bd012c280a7bd8147978b91))
|
|
63
|
+
* make it easier to customize prompts ([1870ee7](https://github.com/ax-llm/ax/commit/1870ee77a0a3491a34570033197efeb87a6f632a))
|
|
64
|
+
* migrated from commonjs to ES2022 ([c8ad44b](https://github.com/ax-llm/ax/commit/c8ad44b6a61246602afb1c3307d46de6b13e8152))
|
|
65
|
+
* multi-modal dsp, use images in input fields ([a170b55](https://github.com/ax-llm/ax/commit/a170b555072baa13a2bc577248ae9d67f8c7db6f))
|
|
66
|
+
* new agent framework ([1e7040c](https://github.com/ax-llm/ax/commit/1e7040ce2049afa270efee5528ea5b954f66188e))
|
|
67
|
+
* new agent prompt ([6c4df2c](https://github.com/ax-llm/ax/commit/6c4df2c50d84adcfc2f18c42033ad82aa7ca6be6))
|
|
68
|
+
* new llm proxy for tracing usage ([ab36530](https://github.com/ax-llm/ax/commit/ab36530aca00510aa1fc339c38317897caa24064))
|
|
69
|
+
* new llmclient command and crawler to embed and vectorize websites ([47a61f2](https://github.com/ax-llm/ax/commit/47a61f25bd4aa84acc7e0c7e59f73e10338372cc))
|
|
70
|
+
* new llmclient command and crawler to embed and vectorize websites ([ede47c5](https://github.com/ax-llm/ax/commit/ede47c5b01fe17056a813fd44ad659186865f134))
|
|
71
|
+
* openapi wispher support ([50e864f](https://github.com/ax-llm/ax/commit/50e864f91806c2d723fe6edd46bc3a6a2ecd17d8))
|
|
72
|
+
* parsing and processing output fields and functions while streaming ([95a7a93](https://github.com/ax-llm/ax/commit/95a7a93b9c40f8e7b25a2dd14b3b43d84a8d50fc))
|
|
73
|
+
* proxy support for all llms ([1e1edc3](https://github.com/ax-llm/ax/commit/1e1edc3a6b61dedbb4b45af011c79974f9fdef1b))
|
|
74
|
+
* req tracing added to ai classes ([dad8c3c](https://github.com/ax-llm/ax/commit/dad8c3caa4f02d70364a3785d9349575b9c102b6))
|
|
75
|
+
* spider to embed website ([56f4598](https://github.com/ax-llm/ax/commit/56f45984f894a790f93819464e0dc0a91b4bc66f))
|
|
76
|
+
* streaming support ([65839a9](https://github.com/ax-llm/ax/commit/65839a9fc041853af10971474bb2f1417919d0d3))
|
|
77
|
+
* support for google vertex ([49ee383](https://github.com/ax-llm/ax/commit/49ee3833e5f2fc423ca8c059670157b20acc8ac6))
|
|
78
|
+
* support for Hugging Face and other updates ([8f64432](https://github.com/ax-llm/ax/commit/8f644328ab10fcd409b98b02807a96fdccbc79e7))
|
|
79
|
+
* support for remote tracing ([033a67a](https://github.com/ax-llm/ax/commit/033a67ab5f6e1f2778ec435fa0e6f181223b6728))
|
|
80
|
+
* track token usage ([bd4f798](https://github.com/ax-llm/ax/commit/bd4f79824a29a89fed60b38bcef28e2935cebb86))
|
|
81
|
+
* true realtime output validation while streaming ([4308b99](https://github.com/ax-llm/ax/commit/4308b99a8855595527fbd161920ae6968292650c))
|
|
82
|
+
* updates to agent framework api ([472efbf](https://github.com/ax-llm/ax/commit/472efbfcfe8f9718a1031263a0363a9a7f72f918))
|
|
83
|
+
* vector db query rewriting ([52fad9c](https://github.com/ax-llm/ax/commit/52fad9cea59c619fd5d9b74ae5139abbec9c4834))
|
|
84
|
+
* vector db query rewriting ([bce6d19](https://github.com/ax-llm/ax/commit/bce6d198c7f807f4e5a97b8e1211107fecaebb9a))
|
|
85
|
+
* vector db support ([0ea1c7f](https://github.com/ax-llm/ax/commit/0ea1c7f0963946ead1ffc0908a8c5c1be5ce00fd))
|
|
86
|
+
* welcome llm-client ([225ec5a](https://github.com/ax-llm/ax/commit/225ec5aa24cf422ed3018e6fd19e248a0a763391))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Bug Fixes
|
|
90
|
+
|
|
91
|
+
* add opentelemetry support and other fixes ([685fe80](https://github.com/ax-llm/ax/commit/685fe80f1687f97282f708d279e8588023e2213c))
|
|
92
|
+
* Add Polyfill for TextDecoderStream to Ensure Compatibility with Bun [#21](https://github.com/ax-llm/ax/issues/21) ([540348d](https://github.com/ax-llm/ax/commit/540348d9b25a361077b0e3574064fb4f2975b632))
|
|
93
|
+
* add tools support to anthropic ([1cc96b7](https://github.com/ax-llm/ax/commit/1cc96b7910127c9e00820b572b5fb6ca27662b1e))
|
|
94
|
+
* added missing typescript docs ([2459a28](https://github.com/ax-llm/ax/commit/2459a282e5cdd8ccc827665fe41f58974023bcfb))
|
|
95
|
+
* added system prompt to trace ([335bb40](https://github.com/ax-llm/ax/commit/335bb406eec22414014bcde8e264bb45bb44ff12))
|
|
96
|
+
* anthropic header issue ([40dbce0](https://github.com/ax-llm/ax/commit/40dbce0bd2ec03f1c9184e66cf88c8dfec31883c))
|
|
97
|
+
* anthropic proxy endpoint ([#7](https://github.com/ax-llm/ax/issues/7)) ([cf7c793](https://github.com/ax-llm/ax/commit/cf7c7939c393e85d63721762a6c7cc55c68502d2))
|
|
98
|
+
* anthropic, updated other models ([6e83d34](https://github.com/ax-llm/ax/commit/6e83d34f5acb8be282e172b47d9feeef0ce67436))
|
|
99
|
+
* Azure OpenAI chat/completion call failed ([#19](https://github.com/ax-llm/ax/issues/19)) ([#20](https://github.com/ax-llm/ax/issues/20)) ([0fad4f9](https://github.com/ax-llm/ax/commit/0fad4f9c3bd909c687b20193a5d0dbef4730481a))
|
|
100
|
+
* banner fixes ([fdf453b](https://github.com/ax-llm/ax/commit/fdf453b1ad02c337bcd0b8c213be3802a054eb9b))
|
|
101
|
+
* blank response with stream ([ab7c62d](https://github.com/ax-llm/ax/commit/ab7c62d52db231ae9661531f85a9d6a4cadfe222))
|
|
102
|
+
* bug in new open ai chat model ([654282d](https://github.com/ax-llm/ax/commit/654282d15c98d617840dc6f6014d0e961393bcd2))
|
|
103
|
+
* bug with exporting enums ([4fc0a3b](https://github.com/ax-llm/ax/commit/4fc0a3b5a7dd5413d8f6d4d3cfe18d2af54941c6))
|
|
104
|
+
* bug with exporting enums ([4ca8c5d](https://github.com/ax-llm/ax/commit/4ca8c5d23ec5b7320cc78936b3a663920ae6946c))
|
|
105
|
+
* build error ([e4d29c3](https://github.com/ax-llm/ax/commit/e4d29c34297c31bfe91def1af3468e6566554ce2))
|
|
106
|
+
* build fixes ([d8d4a47](https://github.com/ax-llm/ax/commit/d8d4a478e70ddfbff785d123f19ff78946f97789))
|
|
107
|
+
* build issue ([7733463](https://github.com/ax-llm/ax/commit/773346339acec1c7f7f9640cdf183b92fee28615))
|
|
108
|
+
* build issue ([071f476](https://github.com/ax-llm/ax/commit/071f476fe8046b561f54786e364517cf52fc91cb))
|
|
109
|
+
* build issue with previous version ([cfe92fd](https://github.com/ax-llm/ax/commit/cfe92fdbe5a2205815da3978a6c9903dcc46b617))
|
|
110
|
+
* build issues ([dd346c4](https://github.com/ax-llm/ax/commit/dd346c4b03aa43b2725ca3da40bab522ffb9297f))
|
|
111
|
+
* build issues ([33394df](https://github.com/ax-llm/ax/commit/33394dfd250e5c0f16bf9baa5c2b23d4d1777ef8))
|
|
112
|
+
* change name in package ([9697d19](https://github.com/ax-llm/ax/commit/9697d190526bfd923baa244aacd8e7522845a340))
|
|
113
|
+
* cleaup gitignore ([6627ff3](https://github.com/ax-llm/ax/commit/6627ff315aacddcfd321d014f7d129cd20142655))
|
|
114
|
+
* common llm model config to ensure more deterministic outputs ([0dce599](https://github.com/ax-llm/ax/commit/0dce59998bc731153a5d3588245e8fbfb7635727))
|
|
115
|
+
* examples ([973eb51](https://github.com/ax-llm/ax/commit/973eb51a23e0a6b4042d37b0e9967de2c0a76234))
|
|
116
|
+
* extra comma in package.json ([16b36f5](https://github.com/ax-llm/ax/commit/16b36f507e9b9e4cde6a823cb0f844f4ec0b3ee1))
|
|
117
|
+
* fix in proxy ([f778c9d](https://github.com/ax-llm/ax/commit/f778c9d2a8337730bc4ab08a0b00e304758d2500))
|
|
118
|
+
* fix in proxy ([f007d26](https://github.com/ax-llm/ax/commit/f007d269abd3768954d9e3428fe81e2ab2110b1c))
|
|
119
|
+
* fix in proxy ([ab87118](https://github.com/ax-llm/ax/commit/ab87118222de01ae4409aa5aaa65cdaa81eaf526))
|
|
120
|
+
* google gemini function calling ([a9214f3](https://github.com/ax-llm/ax/commit/a9214f3e6d2d96b724734e7a128276cbb76ca24d))
|
|
121
|
+
* google gemini now works great ([a6d6528](https://github.com/ax-llm/ax/commit/a6d6528e5f4a3a66be991ef8395159fb66bad1b8))
|
|
122
|
+
* import issues ([ce87294](https://github.com/ax-llm/ax/commit/ce87294cb62e293c6186a922b2a179bcde25baf1))
|
|
123
|
+
* improve examples ([6e656cb](https://github.com/ax-llm/ax/commit/6e656cbe631ff8eb127aae49e799a77cc55cecfb))
|
|
124
|
+
* improved the customer suppot example ([103b072](https://github.com/ax-llm/ax/commit/103b072c241140e380b0695d2c8fbaf5a91d3966))
|
|
125
|
+
* issue with cspell ([806cba1](https://github.com/ax-llm/ax/commit/806cba130fe61f96f8629d8d44344c80306c0611))
|
|
126
|
+
* issue with rate limiter ([0648ad7](https://github.com/ax-llm/ax/commit/0648ad7263493ebc34492cd72ec20704971c088f))
|
|
127
|
+
* json5 build issue ([fe6de9c](https://github.com/ax-llm/ax/commit/fe6de9ce995bc51996b12db57d9f3787bda2abd9))
|
|
128
|
+
* major fixes to function calling ([d44a373](https://github.com/ax-llm/ax/commit/d44a37300f4c427ede9a803939f5b90430e17a30))
|
|
129
|
+
* make mistral function calling work ([6bd9cf7](https://github.com/ax-llm/ax/commit/6bd9cf78b72ddd1b190ab798b47aedeb9a888001))
|
|
130
|
+
* make stop sequence optional ([d18addc](https://github.com/ax-llm/ax/commit/d18addcd287ce17dcd2a2c5feb8b8917d4f4f0e3))
|
|
131
|
+
* migrate npm package to llmclient ([97a4a07](https://github.com/ax-llm/ax/commit/97a4a07ed8e614563c7b7100141ce8bfde6aedb9))
|
|
132
|
+
* minor build fix ([32f04b3](https://github.com/ax-llm/ax/commit/32f04b3e5174a4915d8099c4a32c41979b0c652b))
|
|
133
|
+
* minor fix ([62fbf38](https://github.com/ax-llm/ax/commit/62fbf3807d60e1e367560a08ee40c25b9081137b))
|
|
134
|
+
* minor fixes ([3792700](https://github.com/ax-llm/ax/commit/3792700363172567b836cb5c562a62c41a703ce4))
|
|
135
|
+
* minor fixes ([574f73f](https://github.com/ax-llm/ax/commit/574f73f715f8972dbefa73e09978abf2de8e562c))
|
|
136
|
+
* minor fixes ([5ebf283](https://github.com/ax-llm/ax/commit/5ebf2831a8ecfef56df775ca127c546f0a562516))
|
|
137
|
+
* minor fixes ([5bb612d](https://github.com/ax-llm/ax/commit/5bb612d45a3089d8dac338a2cc8a21d388c161f9))
|
|
138
|
+
* minor fixes ([0fa4687](https://github.com/ax-llm/ax/commit/0fa4687ea70113321c829e9950e5b136da2e830d))
|
|
139
|
+
* minor fixes ([47eef31](https://github.com/ax-llm/ax/commit/47eef314ab5227940700938b08cfdbf39e390a7a))
|
|
140
|
+
* minor fixes ([0da9daf](https://github.com/ax-llm/ax/commit/0da9dafeb6375bdc819b1b0023253bf321f2ff07))
|
|
141
|
+
* minor fixes ([15bd72f](https://github.com/ax-llm/ax/commit/15bd72f9c8fff5b461792076f91e9689e7a55246))
|
|
142
|
+
* minor issue with incorrect error ([65e7ea8](https://github.com/ax-llm/ax/commit/65e7ea8847c98dc1d7ff72c6cb4e305936941330))
|
|
143
|
+
* missing imports ([9071c9e](https://github.com/ax-llm/ax/commit/9071c9e109921ef20d923f51a4d42ccfbb8bb5cd))
|
|
144
|
+
* new ai balancer to route based on token pricing in case of error ([7ea79a9](https://github.com/ax-llm/ax/commit/7ea79a90e0cf633d7517ce32701a9df18ba57b37))
|
|
145
|
+
* openai function tracing fixes ([d623f03](https://github.com/ax-llm/ax/commit/d623f03f6e8c3ad41fe5e919ef9433135bc199d9))
|
|
146
|
+
* opentelemetry tracing added to ai and vectordb ([1918410](https://github.com/ax-llm/ax/commit/1918410f4d83676fbcd9720b5707e5ab664761a6))
|
|
147
|
+
* prettier config ([8f4ca77](https://github.com/ax-llm/ax/commit/8f4ca77ecfe59605295e4f3f465db420e7380b9b))
|
|
148
|
+
* proxy command ([9eaf6e7](https://github.com/ax-llm/ax/commit/9eaf6e757422232135f21250300353735e4d6120))
|
|
149
|
+
* proxy port can be set using the env var PORT ([c08af8d](https://github.com/ax-llm/ax/commit/c08af8d3cac10d544794c618a8ddb6c19684ee7b))
|
|
150
|
+
* refactored request, response tracing ([1ac7023](https://github.com/ax-llm/ax/commit/1ac702334cd09dec9bc2f17944e67397762298ac))
|
|
151
|
+
* refactored usage reporting and other fixes ([84bf661](https://github.com/ax-llm/ax/commit/84bf661389ae806f2730bdd9d9edce2f5b932ede))
|
|
152
|
+
* remove comments ([73e3a30](https://github.com/ax-llm/ax/commit/73e3a3021d63e0b1fb2dcd6fc4b3e7a8267de4b1))
|
|
153
|
+
* remove index folder committed by mistake ([4d327ab](https://github.com/ax-llm/ax/commit/4d327abbbc7fb30041266f8cfdc426c7435c0a5f))
|
|
154
|
+
* removed crawler ([ab4ac6e](https://github.com/ax-llm/ax/commit/ab4ac6e10742611516067d937ab0350338973a3e))
|
|
155
|
+
* removed extra packages ([faae6d2](https://github.com/ax-llm/ax/commit/faae6d2512415cd8419105129a2a63527ec05371))
|
|
156
|
+
* renamed emailprompt to messageprompt ([3063a90](https://github.com/ax-llm/ax/commit/3063a907ed5383c63ed6f79cf1bcc27bf1fd04ac))
|
|
157
|
+
* renamed responseSchema to resultSchema for clarity ([b238b88](https://github.com/ax-llm/ax/commit/b238b88561cea813f3183d419b09b7f3386d16aa))
|
|
158
|
+
* resolved all typescript strict mode errors and warnings ([4f08fac](https://github.com/ax-llm/ax/commit/4f08face90d761faf97609213f88bbc84922d57c))
|
|
159
|
+
* result error-correction fixes ([eeaa12e](https://github.com/ax-llm/ax/commit/eeaa12e605f210df66c82a6f40e368d0ac6f0289))
|
|
160
|
+
* rewrite or error-correction code and other fixes ([37b620e](https://github.com/ax-llm/ax/commit/37b620e576982660d1013547043b07a1642b9892))
|
|
161
|
+
* seperated embed usage data from completion usage ([feb5619](https://github.com/ax-llm/ax/commit/feb5619f4df104e31edfbdd24f909a6c1b255a7f))
|
|
162
|
+
* set default model for openai to gpt3-turbo ([14ba73c](https://github.com/ax-llm/ax/commit/14ba73cc1fc80436c2073c85f5717215d03655a5))
|
|
163
|
+
* signature parser ([a149361](https://github.com/ax-llm/ax/commit/a149361263cae6e4bdc8a425f1abadd38ef9da56))
|
|
164
|
+
* streamlined the llm apis ([0bbc8b0](https://github.com/ax-llm/ax/commit/0bbc8b0729ef95657642ae3459fb43f5bbc666ff))
|
|
165
|
+
* system prompt fixes ([b56201c](https://github.com/ax-llm/ax/commit/b56201caf00df323925d2864f5c70f9ff70ee234))
|
|
166
|
+
* tests breaking ([4c047ce](https://github.com/ax-llm/ax/commit/4c047ce964d626129e0219e2dfef6ce7344f3747))
|
|
167
|
+
* ts cleanup ([be645d9](https://github.com/ax-llm/ax/commit/be645d952bec4d1b5022732a58a8705479147fbd))
|
|
168
|
+
* tuning and optimization fixes ([d0b892c](https://github.com/ax-llm/ax/commit/d0b892c7dd56f5720b75f8fe438cff8a5a29e535))
|
|
169
|
+
* type validation logic ([88eec1e](https://github.com/ax-llm/ax/commit/88eec1ebb4faa126ec491785c552a4958369f030))
|
|
170
|
+
* update model defaults ([1c70dd7](https://github.com/ax-llm/ax/commit/1c70dd7b2631f865216ae4d90c304db56880a806))
|
|
171
|
+
* update model defaults ([cc7e82f](https://github.com/ax-llm/ax/commit/cc7e82f0033f4881bc473dec53dc770023c32eab))
|
|
172
|
+
* update model defaults ([1251372](https://github.com/ax-llm/ax/commit/12513727f3b7f683858eed549f4ecea87883f91e))
|
|
173
|
+
* update package name ([ed5346c](https://github.com/ax-llm/ax/commit/ed5346c029e8228e37bae6494337496db5a4d774))
|
|
174
|
+
* Updated Cohere reqValue to include input_type (required since v3), Groq model to llama3-70b-8192 (llama2-70b-4096 was depreciated), and added a temporary fix to the marketing.py example (messageGuidelines expects a string, not a string array). ([#22](https://github.com/ax-llm/ax/issues/22)) ([5885877](https://github.com/ax-llm/ax/commit/5885877ecb2294566713abe323344c1b67eae9ba))
|
|
175
|
+
* updates to debugging proxy ([6476a23](https://github.com/ax-llm/ax/commit/6476a23a6b297f216b45afff12d1f37883714a92))
|
|
176
|
+
* valid healthcheck path for proxy ([3adea76](https://github.com/ax-llm/ax/commit/3adea76b081cc433450229c449f0c65bcb2a8cf7))
|
|
177
|
+
* various fixes ([a0099a8](https://github.com/ax-llm/ax/commit/a0099a8958fae739d431a82a8715cf86bc2e74b5))
|
|
178
|
+
* various fixes ([7b75342](https://github.com/ax-llm/ax/commit/7b753421b438d2f01ae20b0a25549c994bdd07b3))
|
|
179
|
+
* various fixes ([440cb84](https://github.com/ax-llm/ax/commit/440cb842a8c39f00b1ba7fbb6c4523a1d1275387))
|
|
180
|
+
* various fixes ([516fbcb](https://github.com/ax-llm/ax/commit/516fbcbf69f42d4a3d0a9169098087a0d603e945))
|
|
181
|
+
* various fixes ([0978b29](https://github.com/ax-llm/ax/commit/0978b2904454b1928f5254f1f241797f77a64ac2))
|
|
182
|
+
* various proxy fixes ([61b693a](https://github.com/ax-llm/ax/commit/61b693a9c95b4f173ca48bcc91b9154cfabc2963))
|
|
183
|
+
* version update ([c4794a3](https://github.com/ax-llm/ax/commit/c4794a3e1853c58b60f7e9357d755dab4bca6e4e))
|
|
184
|
+
* zprompt type spec ([db1f7e7](https://github.com/ax-llm/ax/commit/db1f7e75c4ac176ea3ca424e5fc276d5e43081be))
|
package/README.md
CHANGED
|
@@ -63,16 +63,21 @@ yarn add @ax-llm/ax
|
|
|
63
63
|
## Example: Using chain-of-thought to summarize text
|
|
64
64
|
|
|
65
65
|
```typescript
|
|
66
|
-
import {
|
|
66
|
+
import { AxAI, AxChainOfThought } from '@ax-llm/ax';
|
|
67
67
|
|
|
68
68
|
const textToSummarize = `
|
|
69
69
|
The technological singularity—or simply the singularity[1]—is a hypothetical future point in time at which technological growth becomes uncontrollable and irreversible, resulting in unforeseeable changes to human civilization.[2][3] ...`;
|
|
70
70
|
|
|
71
|
-
const ai =
|
|
71
|
+
const ai = new AxAI({
|
|
72
|
+
name: 'openai',
|
|
73
|
+
apiKey: process.env.OPENAI_APIKEY as string
|
|
74
|
+
});
|
|
75
|
+
|
|
72
76
|
const gen = new AxChainOfThought(
|
|
73
77
|
ai,
|
|
74
78
|
`textToSummarize -> shortSummary "summarize in 5 to 10 words"`
|
|
75
79
|
);
|
|
80
|
+
|
|
76
81
|
const res = await gen.forward({ textToSummarize });
|
|
77
82
|
|
|
78
83
|
console.log('>', res);
|
|
@@ -266,7 +271,7 @@ const technicalSupport = new AxRoute('technicalSupport', [
|
|
|
266
271
|
'how do I update to the latest version?'
|
|
267
272
|
]);
|
|
268
273
|
|
|
269
|
-
const ai =
|
|
274
|
+
const ai = new AxAI({ name: 'openai', apiKey: process.env.OPENAI_APIKEY as string });
|
|
270
275
|
|
|
271
276
|
const router = new AxRouter(ai);
|
|
272
277
|
await router.setRoutes(
|
|
@@ -302,10 +307,11 @@ trace.setGlobalTracerProvider(provider);
|
|
|
302
307
|
|
|
303
308
|
const tracer = trace.getTracer('test');
|
|
304
309
|
|
|
305
|
-
const ai =
|
|
306
|
-
|
|
310
|
+
const ai = new AxAI({
|
|
311
|
+
name: 'ollama',
|
|
312
|
+
config: { model: 'nous-hermes2' },
|
|
307
313
|
options: { tracer }
|
|
308
|
-
}
|
|
314
|
+
});
|
|
309
315
|
|
|
310
316
|
const gen = new AxChainOfThought(
|
|
311
317
|
ai,
|
|
@@ -353,7 +359,10 @@ const examples = await hf.getData<{ question: string; answer: string }>({
|
|
|
353
359
|
fields: ['question', 'answer']
|
|
354
360
|
});
|
|
355
361
|
|
|
356
|
-
const ai =
|
|
362
|
+
const ai = new AxAI({
|
|
363
|
+
name: 'openai',
|
|
364
|
+
apiKey: process.env.OPENAI_APIKEY as string
|
|
365
|
+
});
|
|
357
366
|
|
|
358
367
|
// Setup the program to tune
|
|
359
368
|
const program = new AxChainOfThought<{ question: string }, { answer: string }>(
|
|
@@ -383,7 +392,10 @@ await optimize.compile(metricFn, { filename: 'demos.json' });
|
|
|
383
392
|
And to use the generated demos with the above `ChainOfThought` program
|
|
384
393
|
|
|
385
394
|
```typescript
|
|
386
|
-
const ai =
|
|
395
|
+
const ai = new AxAI({
|
|
396
|
+
name: 'openai',
|
|
397
|
+
apiKey: process.env.OPENAI_APIKEY as string
|
|
398
|
+
});
|
|
387
399
|
|
|
388
400
|
// Setup the program to use the tuned data
|
|
389
401
|
const program = new AxChainOfThought<{ question: string }, { answer: string }>(
|
|
@@ -428,6 +440,7 @@ OPENAI_APIKEY=openai_key npm run tsx ./src/examples/marketing.ts
|
|
|
428
440
|
| streaming2.ts | Per output field validation while streaming |
|
|
429
441
|
| smart-hone.ts | Agent looks for dog in smart home |
|
|
430
442
|
| multi-modal.ts | Use an image input along with other text inputs |
|
|
443
|
+
| balancer.ts | Balance between various llm's based on cost, etc |
|
|
431
444
|
|
|
432
445
|
## Built-in Functions
|
|
433
446
|
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { API } from '../../util/apicall.js';
|
|
2
2
|
import { AxBaseAI } from '../base.js';
|
|
3
3
|
import type { AxAIServiceOptions, AxChatRequest, AxChatResponse, AxModelConfig } from '../types.js';
|
|
4
|
-
import { type
|
|
5
|
-
export declare const
|
|
6
|
-
export interface
|
|
4
|
+
import { type AxAIAnthropicChatError, type AxAIAnthropicChatRequest, type AxAIAnthropicChatResponse, type AxAIAnthropicChatResponseDelta, type AxAIAnthropicConfig } from './types.js';
|
|
5
|
+
export declare const axAIAnthropicDefaultConfig: () => AxAIAnthropicConfig;
|
|
6
|
+
export interface AxAIAnthropicArgs {
|
|
7
|
+
name: 'anthropic';
|
|
7
8
|
apiKey: string;
|
|
8
|
-
config?: Readonly<
|
|
9
|
+
config?: Readonly<AxAIAnthropicConfig>;
|
|
9
10
|
options?: Readonly<AxAIServiceOptions>;
|
|
10
11
|
}
|
|
11
|
-
export declare class
|
|
12
|
+
export declare class AxAIAnthropic extends AxBaseAI<AxAIAnthropicChatRequest, unknown, AxAIAnthropicChatResponse, AxAIAnthropicChatResponseDelta, unknown> {
|
|
12
13
|
private config;
|
|
13
|
-
constructor({ apiKey, config, options }: Readonly<
|
|
14
|
+
constructor({ apiKey, config, options }: Readonly<Omit<AxAIAnthropicArgs, 'name'>>);
|
|
14
15
|
getModelConfig(): AxModelConfig;
|
|
15
|
-
generateChatReq: (req: Readonly<AxChatRequest>) => [API,
|
|
16
|
-
generateChatResp: (resp: Readonly<
|
|
17
|
-
generateChatStreamResp: (resp: Readonly<
|
|
16
|
+
generateChatReq: (req: Readonly<AxChatRequest>) => [API, AxAIAnthropicChatRequest];
|
|
17
|
+
generateChatResp: (resp: Readonly<AxAIAnthropicChatResponse | AxAIAnthropicChatError>) => AxChatResponse;
|
|
18
|
+
generateChatStreamResp: (resp: Readonly<AxAIAnthropicChatResponseDelta>, state: object) => AxChatResponse;
|
|
18
19
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { AxBaseAI, axBaseAIDefaultConfig } from '../base.js';
|
|
2
2
|
import { axModelInfoAnthropic } from './info.js';
|
|
3
|
-
import {
|
|
4
|
-
export const
|
|
5
|
-
model:
|
|
3
|
+
import { AxAIAnthropicModel } from './types.js';
|
|
4
|
+
export const axAIAnthropicDefaultConfig = () => structuredClone({
|
|
5
|
+
model: AxAIAnthropicModel.Claude3Haiku,
|
|
6
6
|
...axBaseAIDefaultConfig()
|
|
7
7
|
});
|
|
8
|
-
export class
|
|
8
|
+
export class AxAIAnthropic extends AxBaseAI {
|
|
9
9
|
config;
|
|
10
|
-
constructor({ apiKey, config
|
|
10
|
+
constructor({ apiKey, config, options }) {
|
|
11
11
|
if (!apiKey || apiKey === '') {
|
|
12
12
|
throw new Error('Anthropic API key not set');
|
|
13
13
|
}
|
|
14
|
+
const _config = {
|
|
15
|
+
...axAIAnthropicDefaultConfig(),
|
|
16
|
+
...config
|
|
17
|
+
};
|
|
14
18
|
super({
|
|
15
19
|
name: 'Anthropic',
|
|
16
20
|
apiURL: 'https://api.anthropic.com/v1',
|
|
@@ -19,11 +23,11 @@ export class AxAnthropic extends AxBaseAI {
|
|
|
19
23
|
'x-api-key': apiKey
|
|
20
24
|
},
|
|
21
25
|
modelInfo: axModelInfoAnthropic,
|
|
22
|
-
models: { model:
|
|
26
|
+
models: { model: _config.model },
|
|
23
27
|
options,
|
|
24
28
|
supportFor: { functions: true, streaming: true }
|
|
25
29
|
});
|
|
26
|
-
this.config =
|
|
30
|
+
this.config = _config;
|
|
27
31
|
}
|
|
28
32
|
getModelConfig() {
|
|
29
33
|
const { config } = this;
|
|
@@ -47,7 +51,7 @@ export class AxAnthropic extends AxBaseAI {
|
|
|
47
51
|
}));
|
|
48
52
|
const stream = req.modelConfig?.stream ?? this.config.stream;
|
|
49
53
|
const reqValue = {
|
|
50
|
-
model: req.
|
|
54
|
+
model: req.model ?? this.config.model,
|
|
51
55
|
max_tokens: req.modelConfig?.maxTokens ?? this.config.maxTokens,
|
|
52
56
|
stop_sequences: req.modelConfig?.stopSequences ?? this.config.stopSequences,
|
|
53
57
|
temperature: req.modelConfig?.temperature ?? this.config.temperature,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/ai/anthropic/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAQ7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAWL,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/ai/anthropic/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAA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AI,EAAE,UAAmB;4BACzB,EAAE,EAAE,CAAC,CAAC,EAAE;4BACR,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI;4BACrB,KAAK;yBACN,CAAC;oBACJ,CAAC,CAAC,CAAC;oBACH,OAAO;wBACL,IAAI,EAAE,WAAoB;wBAC1B,OAAO;qBACR,CAAC;gBACJ,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1C,CAAC;YACD;gBACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;QACpC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,eAAe,CACtB,UAA4D;IAE5D,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,eAAe;YAClB,OAAO,MAAM,CAAC;YACd,MAAM;QACR,KAAK,YAAY;YACf,OAAO,QAAQ,CAAC;YAChB,MAAM;QACR,KAAK,UAAU;YACb,OAAO,eAAe,CAAC;YACvB,MAAM;QACR,KAAK,UAAU;YACb,OAAO,MAAM,CAAC;YACd,MAAM;QACR;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxAIAnthropicModel } from './types.js';
|
|
2
2
|
export const axModelInfoAnthropic = [
|
|
3
3
|
{
|
|
4
|
-
name:
|
|
4
|
+
name: AxAIAnthropicModel.Claude35Sonnet,
|
|
5
|
+
currency: 'usd',
|
|
6
|
+
promptTokenCostPer1M: 3.0,
|
|
7
|
+
completionTokenCostPer1M: 15.0
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: AxAIAnthropicModel.Claude3Opus,
|
|
5
11
|
currency: 'usd',
|
|
6
12
|
promptTokenCostPer1M: 15.0,
|
|
7
13
|
completionTokenCostPer1M: 75.0
|
|
8
14
|
},
|
|
9
15
|
{
|
|
10
|
-
name:
|
|
16
|
+
name: AxAIAnthropicModel.Claude3Sonnet,
|
|
11
17
|
currency: 'usd',
|
|
12
18
|
promptTokenCostPer1M: 3.0,
|
|
13
19
|
completionTokenCostPer1M: 15.0
|
|
14
20
|
},
|
|
15
21
|
{
|
|
16
|
-
name:
|
|
22
|
+
name: AxAIAnthropicModel.Claude3Haiku,
|
|
17
23
|
currency: 'usd',
|
|
18
24
|
promptTokenCostPer1M: 0.25,
|
|
19
25
|
completionTokenCostPer1M: 1.25
|
|
20
26
|
},
|
|
21
27
|
{
|
|
22
|
-
name:
|
|
28
|
+
name: AxAIAnthropicModel.Claude21,
|
|
23
29
|
currency: 'usd',
|
|
24
30
|
promptTokenCostPer1M: 8.0,
|
|
25
31
|
completionTokenCostPer1M: 25
|
|
26
32
|
},
|
|
27
33
|
{
|
|
28
|
-
name:
|
|
34
|
+
name: AxAIAnthropicModel.ClaudeInstant12,
|
|
29
35
|
currency: 'usd',
|
|
30
36
|
promptTokenCostPer1M: 0.8,
|
|
31
37
|
completionTokenCostPer1M: 2.24
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../../../src/ai/anthropic/info.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../../../src/ai/anthropic/info.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,oBAAoB,GAAkB;IACjD;QACE,IAAI,EAAE,kBAAkB,CAAC,cAAc;QACvC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,IAAI;KAC/B;IACD;QACE,IAAI,EAAE,kBAAkB,CAAC,WAAW;QACpC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,IAAI;QAC1B,wBAAwB,EAAE,IAAI;KAC/B;IACD;QACE,IAAI,EAAE,kBAAkB,CAAC,aAAa;QACtC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,IAAI;KAC/B;IACD;QACE,IAAI,EAAE,kBAAkB,CAAC,YAAY;QACrC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,IAAI;QAC1B,wBAAwB,EAAE,IAAI;KAC/B;IACD;QACE,IAAI,EAAE,kBAAkB,CAAC,QAAQ;QACjC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,EAAE;KAC7B;IACD;QACE,IAAI,EAAE,kBAAkB,CAAC,eAAe;QACxC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,IAAI;KAC/B;CACF,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import type { AxModelConfig } from '../types.js';
|
|
2
|
-
export declare enum
|
|
2
|
+
export declare enum AxAIAnthropicModel {
|
|
3
|
+
Claude35Sonnet = "claude-3-5-sonnet-20240620",
|
|
3
4
|
Claude3Opus = "claude-3-opus-20240229",
|
|
4
5
|
Claude3Sonnet = "claude-3-sonnet-20240229",
|
|
5
6
|
Claude3Haiku = "claude-3-haiku-20240307",
|
|
6
7
|
Claude21 = "claude-2.1",
|
|
7
8
|
ClaudeInstant12 = "claude-instant-1.2"
|
|
8
9
|
}
|
|
9
|
-
export type
|
|
10
|
-
model:
|
|
10
|
+
export type AxAIAnthropicConfig = AxModelConfig & {
|
|
11
|
+
model: AxAIAnthropicModel;
|
|
11
12
|
};
|
|
12
|
-
export type
|
|
13
|
+
export type AxAIAnthropicChatRequest = {
|
|
13
14
|
model: string;
|
|
14
15
|
messages: ({
|
|
15
16
|
role: 'user';
|
|
@@ -55,7 +56,7 @@ export type AxAnthropicChatRequest = {
|
|
|
55
56
|
user_id: string;
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
|
-
export type
|
|
59
|
+
export type AxAIAnthropicChatResponse = {
|
|
59
60
|
id: string;
|
|
60
61
|
type: 'message';
|
|
61
62
|
role: 'assistant';
|
|
@@ -74,14 +75,14 @@ export type AxAnthropicChatResponse = {
|
|
|
74
75
|
output_tokens: number;
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
|
-
export type
|
|
78
|
+
export type AxAIAnthropicChatError = {
|
|
78
79
|
type: 'error';
|
|
79
80
|
error: {
|
|
80
81
|
type: 'authentication_error';
|
|
81
82
|
message: string;
|
|
82
83
|
};
|
|
83
84
|
};
|
|
84
|
-
export interface
|
|
85
|
+
export interface AxAIAnthropicMessageStartEvent {
|
|
85
86
|
type: 'message_start';
|
|
86
87
|
message: {
|
|
87
88
|
id: string;
|
|
@@ -97,7 +98,7 @@ export interface AxAnthropicMessageStartEvent {
|
|
|
97
98
|
};
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
|
-
export interface
|
|
101
|
+
export interface AxAIAnthropicContentBlockStartEvent {
|
|
101
102
|
index: number;
|
|
102
103
|
type: 'content_block_start';
|
|
103
104
|
content_block: {
|
|
@@ -110,7 +111,7 @@ export interface AxAnthropicContentBlockStartEvent {
|
|
|
110
111
|
input: object;
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
|
-
export interface
|
|
114
|
+
export interface AxAIAnthropicContentBlockDeltaEvent {
|
|
114
115
|
index: number;
|
|
115
116
|
type: 'content_block_delta';
|
|
116
117
|
delta: {
|
|
@@ -121,11 +122,11 @@ export interface AxAnthropicContentBlockDeltaEvent {
|
|
|
121
122
|
partial_json: string;
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
|
-
export interface
|
|
125
|
+
export interface AxAIAnthropicContentBlockStopEvent {
|
|
125
126
|
type: 'content_block_stop';
|
|
126
127
|
index: number;
|
|
127
128
|
}
|
|
128
|
-
export interface
|
|
129
|
+
export interface AxAIAnthropicMessageDeltaEvent {
|
|
129
130
|
type: 'message_delta';
|
|
130
131
|
delta: {
|
|
131
132
|
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | null;
|
|
@@ -135,17 +136,17 @@ export interface AxAnthropicMessageDeltaEvent {
|
|
|
135
136
|
output_tokens: number;
|
|
136
137
|
};
|
|
137
138
|
}
|
|
138
|
-
export interface
|
|
139
|
+
export interface AxAIAnthropicMessageStopEvent {
|
|
139
140
|
type: 'message_stop';
|
|
140
141
|
}
|
|
141
|
-
export interface
|
|
142
|
+
export interface AxAIAnthropicPingEvent {
|
|
142
143
|
type: 'ping';
|
|
143
144
|
}
|
|
144
|
-
export interface
|
|
145
|
+
export interface AxAIAnthropicErrorEvent {
|
|
145
146
|
type: 'error';
|
|
146
147
|
error: {
|
|
147
148
|
type: 'overloaded_error';
|
|
148
149
|
message: string;
|
|
149
150
|
};
|
|
150
151
|
}
|
|
151
|
-
export type
|
|
152
|
+
export type AxAIAnthropicChatResponseDelta = AxAIAnthropicMessageStartEvent | AxAIAnthropicContentBlockStartEvent | AxAIAnthropicContentBlockDeltaEvent | AxAIAnthropicContentBlockStopEvent | AxAIAnthropicMessageDeltaEvent | AxAIAnthropicMessageStopEvent | AxAIAnthropicPingEvent | AxAIAnthropicErrorEvent;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export var AxAIAnthropicModel;
|
|
2
|
+
(function (AxAIAnthropicModel) {
|
|
3
|
+
AxAIAnthropicModel["Claude35Sonnet"] = "claude-3-5-sonnet-20240620";
|
|
4
|
+
AxAIAnthropicModel["Claude3Opus"] = "claude-3-opus-20240229";
|
|
5
|
+
AxAIAnthropicModel["Claude3Sonnet"] = "claude-3-sonnet-20240229";
|
|
6
|
+
AxAIAnthropicModel["Claude3Haiku"] = "claude-3-haiku-20240307";
|
|
7
|
+
AxAIAnthropicModel["Claude21"] = "claude-2.1";
|
|
8
|
+
AxAIAnthropicModel["ClaudeInstant12"] = "claude-instant-1.2";
|
|
9
|
+
})(AxAIAnthropicModel || (AxAIAnthropicModel = {}));
|
|
9
10
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/ai/anthropic/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/ai/anthropic/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,mEAA6C,CAAA;IAC7C,4DAAsC,CAAA;IACtC,gEAA0C,CAAA;IAC1C,8DAAwC,CAAA;IACxC,6CAAuB,CAAA;IACvB,4DAAsC,CAAA;AACxC,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { AxAIOpenAI } from '../openai/api.js';
|
|
2
|
+
import type { AxAIOpenAIConfig } from '../openai/types.js';
|
|
3
3
|
import type { AxAIServiceOptions } from '../types.js';
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export interface
|
|
4
|
+
export declare const axAIAzureOpenAIDefaultConfig: () => AxAIOpenAIConfig;
|
|
5
|
+
export declare const axAIAzureOpenAICreativeConfig: () => AxAIOpenAIConfig;
|
|
6
|
+
export declare const axAIAzureOpenAIFastConfig: () => AxAIOpenAIConfig;
|
|
7
|
+
export declare const axAIAzureOpenAIBestConfig: () => AxAIOpenAIConfig;
|
|
8
|
+
export interface AxAIAzureOpenAIArgs {
|
|
9
|
+
name: 'azure-openai';
|
|
9
10
|
apiKey: string;
|
|
10
11
|
resourceName: string;
|
|
11
12
|
deploymentName: string;
|
|
12
13
|
version?: string;
|
|
13
|
-
config
|
|
14
|
+
config?: Readonly<AxAIOpenAIConfig>;
|
|
14
15
|
options?: Readonly<AxAIServiceOptions>;
|
|
15
16
|
}
|
|
16
|
-
export declare class
|
|
17
|
-
constructor({ apiKey, resourceName, deploymentName, version, config, options }: Readonly<
|
|
17
|
+
export declare class AxAIAzureOpenAI extends AxAIOpenAI {
|
|
18
|
+
constructor({ apiKey, resourceName, deploymentName, version, config, options }: Readonly<Omit<AxAIAzureOpenAIArgs, 'name'>>);
|
|
18
19
|
}
|