├── .circleci └── config.yml ├── .cspell └── project-words.txt ├── .editorconfig ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── npm-publish.yml │ └── static.yml ├── .gitignore ├── .node-version ├── .prettierrc ├── .release-it.json ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── SECURITY.md ├── ax.pdf ├── cspell.json ├── customFrontmatter.mjs ├── eslint.config.js ├── media ├── signatures.png └── tune-prompt.png ├── package-lock.json ├── package.json ├── scripts ├── clean.js ├── generateIndex.ts └── postbuild.js ├── src ├── ai-sdk-provider │ ├── .prettierignore │ ├── .release-it.json │ ├── index.test.ts │ ├── index.ts │ ├── package.json │ ├── provider.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── util.ts ├── ax │ ├── .prettierignore │ ├── .release-it.json │ ├── ai │ │ ├── anthropic │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── azure-openai │ │ │ └── api.ts │ │ ├── balance.test.ts │ │ ├── balance.ts │ │ ├── base.test.ts │ │ ├── base.ts │ │ ├── cohere │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── debug.ts │ │ ├── deepseek │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── google-gemini │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── google-vertex │ │ │ └── auth.ts │ │ ├── groq │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── huggingface │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── mistral │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── mock │ │ │ └── api.ts │ │ ├── multiservice.test.ts │ │ ├── multiservice.ts │ │ ├── ollama │ │ │ └── api.ts │ │ ├── openai │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── reka │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ │ ├── together │ │ │ ├── api.ts │ │ │ └── info.ts │ │ ├── types.ts │ │ ├── util.ts │ │ ├── wrap.ts │ │ └── x-grok │ │ │ ├── api.ts │ │ │ ├── info.ts │ │ │ └── types.ts │ ├── db │ │ ├── base.ts │ │ ├── cloudflare.ts │ │ ├── memory.ts │ │ ├── pinecone.ts │ │ ├── types.ts │ │ ├── weaviate.ts │ │ └── wrap.ts │ ├── docs │ │ ├── manager.ts │ │ ├── reranker.ts │ │ ├── rewriter.ts │ │ └── tika.ts │ ├── dsp │ │ ├── asserts.ts │ │ ├── classifier.ts │ │ ├── datetime.test.ts │ │ ├── datetime.ts │ │ ├── eval.ts │ │ ├── evaluate.ts │ │ ├── extract.test.ts │ │ ├── extract.ts │ │ ├── fieldProcessor.test.ts │ │ ├── fieldProcessor.ts │ │ ├── functions.ts │ │ ├── generate.test.ts │ │ ├── generate.ts │ │ ├── jsonschema.ts │ │ ├── loader.ts │ │ ├── mipro.ts │ │ ├── modelinfo.test.ts │ │ ├── modelinfo.ts │ │ ├── optimize.ts │ │ ├── parser.test.ts │ │ ├── parser.ts │ │ ├── program.ts │ │ ├── prompt.ts │ │ ├── registry.ts │ │ ├── sig.test.ts │ │ ├── sig.ts │ │ ├── stopwords.ts │ │ ├── strutil.ts │ │ ├── util.test.ts │ │ ├── util.ts │ │ └── validate.ts │ ├── funcs │ │ ├── code.ts │ │ ├── docker.ts │ │ └── embed.ts │ ├── index.test-d.ts │ ├── index.ts │ ├── mcp │ │ ├── client.test.ts │ │ ├── client.ts │ │ ├── httpTransport.ts │ │ ├── stdioTransport.ts │ │ ├── transport.ts │ │ └── types.ts │ ├── mem │ │ ├── memory.test.ts │ │ ├── memory.ts │ │ └── types.ts │ ├── package.json │ ├── prompts │ │ ├── agent.test.ts │ │ ├── agent.ts │ │ ├── cot.ts │ │ ├── prompts.test.ts │ │ └── rag.ts │ ├── trace │ │ └── trace.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ ├── typedoc.json │ └── util │ │ ├── apicall.ts │ │ ├── log.ts │ │ ├── other.ts │ │ ├── rate-limit.ts │ │ ├── sse.ts │ │ ├── stream.ts │ │ └── transform.ts ├── docs │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ └── launch.json │ ├── astro.config.mjs │ ├── package.json │ ├── public │ │ ├── favicon.svg │ │ └── mattress.png │ ├── src │ │ ├── assets │ │ │ ├── ax-logo.png │ │ │ ├── mattress.png │ │ │ └── spacy.jpg │ │ ├── components │ │ │ ├── Footer.astro │ │ │ ├── Header.astro │ │ │ └── Navigation.astro │ │ ├── content │ │ │ ├── config.ts │ │ │ └── docs │ │ │ │ ├── .gitignore │ │ │ │ ├── 01-start │ │ │ │ ├── 01-about.md │ │ │ │ ├── 02-signatures.md │ │ │ │ ├── 03-llms.md │ │ │ │ ├── 04-quick.md │ │ │ │ ├── 05-rag.md │ │ │ │ ├── 06-multi-modal.md │ │ │ │ ├── 07-routing.md │ │ │ │ ├── 08-mcp.md │ │ │ │ ├── 09-streaming.md │ │ │ │ ├── 10-vercel-ai-sdk.md │ │ │ │ ├── 11-tuning-basic.md │ │ │ │ └── 12-tuning-mipro.md │ │ │ │ ├── 02-guides │ │ │ │ ├── 01-dsp.md │ │ │ │ ├── 02-functions.md │ │ │ │ └── 03-tuning.md │ │ │ │ ├── 03-apidocs │ │ │ │ ├── Class.AxAI.md │ │ │ │ ├── Class.AxAIAnthropic.md │ │ │ │ ├── Class.AxAIAzureOpenAI.md │ │ │ │ ├── Class.AxAICohere.md │ │ │ │ ├── Class.AxAIDeepSeek.md │ │ │ │ ├── Class.AxAIGoogleGemini.md │ │ │ │ ├── Class.AxAIGroq.md │ │ │ │ ├── Class.AxAIHuggingFace.md │ │ │ │ ├── Class.AxAIMistral.md │ │ │ │ ├── Class.AxAIOllama.md │ │ │ │ ├── Class.AxAIOpenAI.md │ │ │ │ ├── Class.AxAIReka.md │ │ │ │ ├── Class.AxAITogether.md │ │ │ │ ├── Class.AxAgent.md │ │ │ │ ├── Class.AxApacheTika.md │ │ │ │ ├── Class.AxAssertionError.md │ │ │ │ ├── Class.AxBalancer.md │ │ │ │ ├── Class.AxBaseAI.md │ │ │ │ ├── Class.AxBootstrapFewShot.md │ │ │ │ ├── Class.AxChainOfThought.md │ │ │ │ ├── Class.AxDB.md │ │ │ │ ├── Class.AxDBBase.md │ │ │ │ ├── Class.AxDBCloudflare.md │ │ │ │ ├── Class.AxDBManager.md │ │ │ │ ├── Class.AxDBMemory.md │ │ │ │ ├── Class.AxDBPinecone.md │ │ │ │ ├── Class.AxDBWeaviate.md │ │ │ │ ├── Class.AxDefaultQueryRewriter.md │ │ │ │ ├── Class.AxDefaultResultReranker.md │ │ │ │ ├── Class.AxDockerSession.md │ │ │ │ ├── Class.AxEmbeddingAdapter.md │ │ │ │ ├── Class.AxFunctionProcessor.md │ │ │ │ ├── Class.AxGen.md │ │ │ │ ├── Class.AxHFDataLoader.md │ │ │ │ ├── Class.AxInstanceRegistry.md │ │ │ │ ├── Class.AxJSInterpreter.md │ │ │ │ ├── Class.AxMemory.md │ │ │ │ ├── Class.AxProgram.md │ │ │ │ ├── Class.AxProgramWithSignature.md │ │ │ │ ├── Class.AxPromptTemplate.md │ │ │ │ ├── Class.AxRAG.md │ │ │ │ ├── Class.AxRateLimiterTokenUsage.md │ │ │ │ ├── Class.AxRoute.md │ │ │ │ ├── Class.AxRouter.md │ │ │ │ ├── Class.AxSignature.md │ │ │ │ ├── Class.AxTestPrompt.md │ │ │ │ ├── Enumeration.AxAIAnthropicModel.md │ │ │ │ ├── Enumeration.AxAICohereEmbedModel.md │ │ │ │ ├── Enumeration.AxAICohereModel.md │ │ │ │ ├── Enumeration.AxAIDeepSeekModel.md │ │ │ │ ├── Enumeration.AxAIGoogleGeminiEmbedModel.md │ │ │ │ ├── Enumeration.AxAIGoogleGeminiModel.md │ │ │ │ ├── Enumeration.AxAIGoogleGeminiSafetyCategory.md │ │ │ │ ├── Enumeration.AxAIGoogleGeminiSafetyThreshold.md │ │ │ │ ├── Enumeration.AxAIGroqModel.md │ │ │ │ ├── Enumeration.AxAIHuggingFaceModel.md │ │ │ │ ├── Enumeration.AxAIMistralEmbedModels.md │ │ │ │ ├── Enumeration.AxAIMistralModel.md │ │ │ │ ├── Enumeration.AxAIOpenAIEmbedModel.md │ │ │ │ ├── Enumeration.AxAIOpenAIModel.md │ │ │ │ ├── Enumeration.AxAIRekaModel.md │ │ │ │ ├── Enumeration.AxJSInterpreterPermission.md │ │ │ │ ├── Enumeration.AxLLMRequestTypeValues.md │ │ │ │ ├── Enumeration.AxSpanKindValues.md │ │ │ │ ├── Interface.AxAIAnthropicArgs.md │ │ │ │ ├── Interface.AxAIAnthropicContentBlockDeltaEvent.md │ │ │ │ ├── Interface.AxAIAnthropicContentBlockStartEvent.md │ │ │ │ ├── Interface.AxAIAnthropicContentBlockStopEvent.md │ │ │ │ ├── Interface.AxAIAnthropicErrorEvent.md │ │ │ │ ├── Interface.AxAIAnthropicMessageDeltaEvent.md │ │ │ │ ├── Interface.AxAIAnthropicMessageStartEvent.md │ │ │ │ ├── Interface.AxAIAnthropicMessageStopEvent.md │ │ │ │ ├── Interface.AxAIAnthropicPingEvent.md │ │ │ │ ├── Interface.AxAICohereArgs.md │ │ │ │ ├── Interface.AxAIGoogleGeminiArgs.md │ │ │ │ ├── Interface.AxAIGoogleGeminiOptionsTools.md │ │ │ │ ├── Interface.AxAIHuggingFaceArgs.md │ │ │ │ ├── Interface.AxAIMemory.md │ │ │ │ ├── Interface.AxAIOpenAIArgs.md │ │ │ │ ├── Interface.AxAIOpenAIResponseDelta.md │ │ │ │ ├── Interface.AxAIRekaArgs.md │ │ │ │ ├── Interface.AxAIService.md │ │ │ │ ├── Interface.AxAIServiceImpl.md │ │ │ │ ├── Interface.AxAIServiceMetrics.md │ │ │ │ ├── Interface.AxAgentic.md │ │ │ │ ├── Interface.AxApacheTikaArgs.md │ │ │ │ ├── Interface.AxApacheTikaConvertOptions.md │ │ │ │ ├── Interface.AxAssertion.md │ │ │ │ ├── Interface.AxBaseAIArgs.md │ │ │ │ ├── Interface.AxDBBaseArgs.md │ │ │ │ ├── Interface.AxDBBaseOpOptions.md │ │ │ │ ├── Interface.AxDBCloudflareArgs.md │ │ │ │ ├── Interface.AxDBLoaderOptions.md │ │ │ │ ├── Interface.AxDBManagerArgs.md │ │ │ │ ├── Interface.AxDBMatch.md │ │ │ │ ├── Interface.AxDBMemoryArgs.md │ │ │ │ ├── Interface.AxDBPineconeArgs.md │ │ │ │ ├── Interface.AxDBQueryService.md │ │ │ │ ├── Interface.AxDBService.md │ │ │ │ ├── Interface.AxDBWeaviateArgs.md │ │ │ │ ├── Interface.AxDockerContainer.md │ │ │ │ ├── Interface.AxField.md │ │ │ │ ├── Interface.AxGenOptions.md │ │ │ │ ├── Interface.AxProgramWithSignatureOptions.md │ │ │ │ ├── Interface.AxRateLimiterTokenUsageOptions.md │ │ │ │ ├── Interface.AxResponseHandlerArgs.md │ │ │ │ ├── Interface.AxRouterForwardOptions.md │ │ │ │ ├── Interface.AxStreamingAssertion.md │ │ │ │ ├── Interface.AxTunable.md │ │ │ │ ├── Interface.AxUsable.md │ │ │ │ ├── README.md │ │ │ │ ├── TypeAlias.AxAIAnthropicChatError.md │ │ │ │ ├── TypeAlias.AxAIAnthropicChatRequest.md │ │ │ │ ├── TypeAlias.AxAIAnthropicChatRequestCacheParam.md │ │ │ │ ├── TypeAlias.AxAIAnthropicChatResponse.md │ │ │ │ ├── TypeAlias.AxAIAnthropicChatResponseDelta.md │ │ │ │ ├── TypeAlias.AxAIAnthropicConfig.md │ │ │ │ ├── TypeAlias.AxAIArgs.md │ │ │ │ ├── TypeAlias.AxAICohereChatRequest.md │ │ │ │ ├── TypeAlias.AxAICohereChatRequestToolResults.md │ │ │ │ ├── TypeAlias.AxAICohereChatResponse.md │ │ │ │ ├── TypeAlias.AxAICohereChatResponseDelta.md │ │ │ │ ├── TypeAlias.AxAICohereChatResponseToolCalls.md │ │ │ │ ├── TypeAlias.AxAICohereConfig.md │ │ │ │ ├── TypeAlias.AxAICohereEmbedRequest.md │ │ │ │ ├── TypeAlias.AxAICohereEmbedResponse.md │ │ │ │ ├── TypeAlias.AxAIEmbedModels.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiBatchEmbedRequest.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiBatchEmbedResponse.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiChatRequest.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiChatResponse.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiChatResponseDelta.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiConfig.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiContent.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiGenerationConfig.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiSafetySettings.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiTool.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiToolConfig.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiToolFunctionDeclaration.md │ │ │ │ ├── TypeAlias.AxAIGoogleGeminiToolGoogleSearchRetrieval.md │ │ │ │ ├── TypeAlias.AxAIHuggingFaceConfig.md │ │ │ │ ├── TypeAlias.AxAIHuggingFaceRequest.md │ │ │ │ ├── TypeAlias.AxAIHuggingFaceResponse.md │ │ │ │ ├── TypeAlias.AxAIModels.md │ │ │ │ ├── TypeAlias.AxAIOllamaAIConfig.md │ │ │ │ ├── TypeAlias.AxAIOllamaArgs.md │ │ │ │ ├── TypeAlias.AxAIOpenAIChatRequest.md │ │ │ │ ├── TypeAlias.AxAIOpenAIChatResponse.md │ │ │ │ ├── TypeAlias.AxAIOpenAIChatResponseDelta.md │ │ │ │ ├── TypeAlias.AxAIOpenAIConfig.md │ │ │ │ ├── TypeAlias.AxAIOpenAIEmbedRequest.md │ │ │ │ ├── TypeAlias.AxAIOpenAIEmbedResponse.md │ │ │ │ ├── TypeAlias.AxAIOpenAILogprob.md │ │ │ │ ├── TypeAlias.AxAIOpenAIUsage.md │ │ │ │ ├── TypeAlias.AxAIPromptConfig.md │ │ │ │ ├── TypeAlias.AxAIRekaChatRequest.md │ │ │ │ ├── TypeAlias.AxAIRekaChatResponse.md │ │ │ │ ├── TypeAlias.AxAIRekaChatResponseDelta.md │ │ │ │ ├── TypeAlias.AxAIRekaConfig.md │ │ │ │ ├── TypeAlias.AxAIRekaUsage.md │ │ │ │ ├── TypeAlias.AxAIServiceActionOptions.md │ │ │ │ ├── TypeAlias.AxAIServiceOptions.md │ │ │ │ ├── TypeAlias.AxAgentOptions.md │ │ │ │ ├── TypeAlias.AxBalancerOptions.md │ │ │ │ ├── TypeAlias.AxChatRequest.md │ │ │ │ ├── TypeAlias.AxChatResponse.md │ │ │ │ ├── TypeAlias.AxChatResponseFunctionCall.md │ │ │ │ ├── TypeAlias.AxChatResponseResult.md │ │ │ │ ├── TypeAlias.AxDBArgs.md │ │ │ │ ├── TypeAlias.AxDBCloudflareOpOptions.md │ │ │ │ ├── TypeAlias.AxDBMemoryOpOptions.md │ │ │ │ ├── TypeAlias.AxDBPineconeOpOptions.md │ │ │ │ ├── TypeAlias.AxDBQueryRequest.md │ │ │ │ ├── TypeAlias.AxDBQueryResponse.md │ │ │ │ ├── TypeAlias.AxDBState.md │ │ │ │ ├── TypeAlias.AxDBUpsertRequest.md │ │ │ │ ├── TypeAlias.AxDBUpsertResponse.md │ │ │ │ ├── TypeAlias.AxDBWeaviateOpOptions.md │ │ │ │ ├── TypeAlias.AxDataRow.md │ │ │ │ ├── TypeAlias.AxEmbedRequest.md │ │ │ │ ├── TypeAlias.AxEmbedResponse.md │ │ │ │ ├── TypeAlias.AxEvaluateArgs.md │ │ │ │ ├── TypeAlias.AxExample.md │ │ │ │ ├── TypeAlias.AxFieldTemplateFn.md │ │ │ │ ├── TypeAlias.AxFieldValue.md │ │ │ │ ├── TypeAlias.AxFunction.md │ │ │ │ ├── TypeAlias.AxFunctionHandler.md │ │ │ │ ├── TypeAlias.AxFunctionJSONSchema.md │ │ │ │ ├── TypeAlias.AxGenIn.md │ │ │ │ ├── TypeAlias.AxGenOut.md │ │ │ │ ├── TypeAlias.AxGenerateResult.md │ │ │ │ ├── TypeAlias.AxIField.md │ │ │ │ ├── TypeAlias.AxInputFunctionType.md │ │ │ │ ├── TypeAlias.AxInternalChatRequest.md │ │ │ │ ├── TypeAlias.AxInternalEmbedRequest.md │ │ │ │ ├── TypeAlias.AxMetricFn.md │ │ │ │ ├── TypeAlias.AxMetricFnArgs.md │ │ │ │ ├── TypeAlias.AxModelConfig.md │ │ │ │ ├── TypeAlias.AxModelInfo.md │ │ │ │ ├── TypeAlias.AxModelInfoWithProvider.md │ │ │ │ ├── TypeAlias.AxOptimizerArgs.md │ │ │ │ ├── TypeAlias.AxProgramDemos.md │ │ │ │ ├── TypeAlias.AxProgramExamples.md │ │ │ │ ├── TypeAlias.AxProgramForwardOptions.md │ │ │ │ ├── TypeAlias.AxProgramTrace.md │ │ │ │ ├── TypeAlias.AxProgramUsage.md │ │ │ │ ├── TypeAlias.AxRateLimiterFunction.md │ │ │ │ ├── TypeAlias.AxRerankerIn.md │ │ │ │ ├── TypeAlias.AxRerankerOut.md │ │ │ │ ├── TypeAlias.AxRewriteIn.md │ │ │ │ ├── TypeAlias.AxRewriteOut.md │ │ │ │ └── TypeAlias.AxTokenUsage.md │ │ │ │ └── index.mdx │ │ ├── env.d.ts │ │ ├── pages │ │ │ ├── api.astro │ │ │ └── index.astro │ │ └── styles │ │ │ └── custom.css │ ├── tailwind.config.mjs │ └── tsconfig.json └── examples │ ├── agent.ts │ ├── assets │ └── kitten.jpeg │ ├── balancer.ts │ ├── chain-of-thought.ts │ ├── customer-support.ts │ ├── docker.ts │ ├── dope-or-nope.ts │ ├── embed.ts │ ├── extract-test.ts │ ├── extract.ts │ ├── fibonacci.ts │ ├── food-search.ts │ ├── function.ts │ ├── marketing.ts │ ├── mcp-client-blender.ts │ ├── mcp-client-memory.ts │ ├── meetings.ts │ ├── multi-modal.ts │ ├── package.json │ ├── prime.ts │ ├── rag-docs.ts │ ├── rag.ts │ ├── react.ts │ ├── simple-classify.ts │ ├── smart-home.ts │ ├── streaming1.ts │ ├── streaming2.ts │ ├── streaming3.ts │ ├── summarize.ts │ ├── telemetry.ts │ ├── tsconfig.json │ ├── tune-bootstrap.ts │ ├── tune-mipro.ts │ ├── tune-usage.ts │ └── vectordb.ts ├── tsconfig.json └── typedoc.json /.cspell/project-words.txt: -------------------------------------------------------------------------------- 1 | # New Words 2 | agentic 3 | apicall 4 | APIKEY 5 | APITOKEN 6 | APIURL 7 | asig 8 | astro 9 | astrojs 10 | bootstrapper 11 | Buena 12 | chrono 13 | chunker 14 | codellama 15 | Codellama 16 | codestral 17 | Codestral 18 | commandline 19 | companys 20 | countrys 21 | datetime 22 | davinci 23 | Davinci 24 | dedup 25 | deepseek 26 | distractor 27 | dosco 28 | fewshot 29 | fres 30 | frontmatter 31 | fstate 32 | googleauth 33 | groq 34 | Groq 35 | Hono 36 | huggingface 37 | Jiro 38 | jwtx 39 | Kita 40 | llmclient 41 | logit 42 | Logit 43 | Logprob 44 | logprobs 45 | Logprobs 46 | Macbook 47 | MCPHTTP 48 | minibatch 49 | minilm 50 | mipro 51 | Mixtral 52 | modelcontextprotocol 53 | modelinfo 54 | multiservice 55 | nanos 56 | nemo 57 | Nemo 58 | neumann 59 | ollama 60 | onopentag 61 | ontext 62 | openai 63 | OPENAI 64 | Opentable 65 | opentelemetry 66 | parisienne 67 | pegjs 68 | postbuild 69 | qsig 70 | région 71 | reka 72 | rerank 73 | reranker 74 | retryable 75 | retval 76 | sandboxed 77 | sdata 78 | shadcn 79 | Signture 80 | sstate 81 | Stonebraker 82 | stopwords 83 | Streamable 84 | strutil 85 | subjobs 86 | Sukiyabashi 87 | superintelligence 88 | textembedding 89 | tika 90 | trainset 91 | tsimp 92 | tsup 93 | upsert 94 | upserted 95 | usecase 96 | uuidv 97 | valset 98 | vectordb 99 | vectorize 100 | Vikram 101 | weaviate 102 | Weaviate 103 | xlarge 104 | xstate 105 | minibatching 106 | minibatches -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | max_line_length = 80 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | max_line_length = 0 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Example Contributing Guidelines 2 | 3 | This is an example of GitHub's contributing guidelines file. Check out GitHub's [CONTRIBUTING.md help center article](https://help.github.com/articles/setting-guidelines-for-repository-contributors/) for more information. 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | - **I'm submitting a ...** 2 | [ ] bug report 3 | [ ] feature request 4 | [ ] question about the decisions made in the repository 5 | [ ] question about how to use this project 6 | 7 | - **Summary** 8 | 9 | - **Other information** (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.) 10 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | - **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) 2 | 3 | - **What is the current behavior?** (You can also link to an open issue here) 4 | 5 | - **What is the new behavior (if this is a feature change)?** 6 | 7 | - **Other information**: 8 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # .github/dependabot.yml 2 | version: 2 3 | updates: 4 | # Root package.json 5 | - package-ecosystem: 'npm' 6 | directory: '/' 7 | schedule: 8 | interval: 'weekly' 9 | day: 'monday' 10 | open-pull-requests-limit: 10 11 | versioning-strategy: increase 12 | groups: 13 | typescript-eslint: 14 | patterns: 15 | - '@typescript-eslint/*' 16 | dev-dependencies: 17 | dependency-type: 'development' 18 | 19 | # Your ax-llm/ax package in src directory 20 | - package-ecosystem: 'npm' 21 | directory: '/src/ax' # Adjusted to match your src/* workspace pattern 22 | schedule: 23 | interval: 'weekly' 24 | day: 'monday' 25 | groups: 26 | typescript-eslint: 27 | patterns: 28 | - '@typescript-eslint/*' 29 | dev-dependencies: 30 | dependency-type: 'development' 31 | 32 | # GitHub Actions 33 | - package-ecosystem: 'github-actions' 34 | directory: '/' 35 | schedule: 36 | interval: 'weekly' 37 | day: 'monday' 38 | commit-message: 39 | prefix: 'ci' 40 | include: 'scope' 41 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created 2 | # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages 3 | 4 | name: Publish Package to npmjs 5 | on: 6 | release: 7 | types: [published] 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | contents: read 13 | id-token: write 14 | steps: 15 | - uses: actions/checkout@v4 16 | # Setup .npmrc file to publish to npm 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: '20.x' 20 | registry-url: 'https://registry.npmjs.org' 21 | - run: npm ci 22 | - run: npm run publish 23 | env: 24 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 25 | -------------------------------------------------------------------------------- /.github/workflows/static.yml: -------------------------------------------------------------------------------- 1 | # Simple workflow for deploying static content to GitHub Pages 2 | name: Deploy static content to Pages 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: ['main'] 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 13 | permissions: 14 | contents: read 15 | pages: write 16 | id-token: write 17 | 18 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 19 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 20 | concurrency: 21 | group: 'pages' 22 | cancel-in-progress: false 23 | 24 | jobs: 25 | # Single deploy job since we're just deploying 26 | deploy: 27 | environment: 28 | name: github-pages 29 | url: ${{ steps.deployment.outputs.page_url }} 30 | runs-on: ubuntu-latest 31 | steps: 32 | - name: Checkout 33 | uses: actions/checkout@v4 34 | - uses: actions/setup-node@v4 35 | with: 36 | node-version: '20.x' 37 | registry-url: 'https://registry.npmjs.org' 38 | - run: npm ci 39 | - run: npm run doc:build 40 | - name: Setup Pages 41 | uses: actions/configure-pages@v5 42 | - name: Upload artifact 43 | uses: actions/upload-pages-artifact@v3 44 | with: 45 | # Upload entire repository 46 | path: './src/docs/dist' 47 | - name: Deploy to GitHub Pages 48 | id: deployment 49 | uses: actions/deploy-pages@v4 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea/* 3 | .nyc_output 4 | build 5 | dist 6 | node_modules 7 | test 8 | coverage 9 | *.log 10 | yarn.lock 11 | *.mp3 12 | audio 13 | .env 14 | .env.* 15 | .data 16 | demos.json 17 | site/dist 18 | .astro 19 | .tsimp 20 | *.mp4 21 | *.webm 22 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | v20 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true, 4 | "trailingComma": "es5", 5 | "printWidth": 80 6 | } 7 | -------------------------------------------------------------------------------- /.release-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "npm": { 3 | "publish": false 4 | }, 5 | "git": { 6 | "commitMessage": "chore: release v${version}", 7 | "requireCleanWorkingDir": false 8 | }, 9 | "github": { 10 | "release": true, 11 | "web": true, 12 | "releaseName": "Release ${version}", 13 | "releaseNotes": "git log --no-merges --pretty=format:\"* %s %h\" ${latestTag}...main" 14 | }, 15 | "plugins": { 16 | "@release-it/conventional-changelog": { 17 | "preset": { 18 | "name": "conventionalcommits" 19 | }, 20 | "infile": "CHANGELOG.md" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode", 5 | "eamodio.gitlens", 6 | "streetsidesoftware.code-spell-checker", 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | // To debug, make sure a *.spec.ts file is active in the editor, then run a configuration 5 | { 6 | "type": "node", 7 | "request": "launch", 8 | "name": "Debug Active Spec", 9 | "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava", 10 | "runtimeArgs": ["debug", "--break", "--serial", "${file}"], 11 | "port": 9229, 12 | "outputCapture": "std", 13 | "skipFiles": ["/**/*.js"], 14 | "preLaunchTask": "npm: build" 15 | // "smartStep": true 16 | }, 17 | { 18 | // Use this one if you're already running `yarn watch` 19 | "type": "node", 20 | "request": "launch", 21 | "name": "Debug Active Spec (no build)", 22 | "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava", 23 | "runtimeArgs": ["debug", "--break", "--serial", "${file}"], 24 | "port": 9229, 25 | "outputCapture": "std", 26 | "skipFiles": ["/**/*.js"] 27 | // "smartStep": true 28 | }] 29 | } 30 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.userWords": [], // only use words from .cspell.json 3 | "cSpell.enabled": true, 4 | "editor.formatOnSave": true, 5 | "typescript.tsdk": "./node_modules/typescript/lib", 6 | "typescript.enablePromptUseWorkspaceTsdk": true, 7 | "typescript.format.enable": true, 8 | "typescript.tsserver.watchOptions": {}, 9 | "js/ts.implicitProjectConfig.target": "ESNext", 10 | "biome.enabled": false 11 | } 12 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | latest | :white_check_mark: | 11 | 12 | ## Reporting a Vulnerability 13 | 14 | To report vulnerabilities please email use the private reporting feature of Github. 15 | https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability 16 | -------------------------------------------------------------------------------- /ax.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ax-llm/ax/8b26b7e43ca1221e8cfd180704f9e879ab52c314/ax.pdf -------------------------------------------------------------------------------- /cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "dictionaryDefinitions": [ 3 | { 4 | "name": "project-words", 5 | "path": "./.cspell/project-words.txt", 6 | "addWords": true 7 | } 8 | ], 9 | "dictionaries": ["project-words"], 10 | "ignorePaths": [ 11 | "CHANGELOG.md", 12 | "node_modules", 13 | "./src/ax/dsp/stopwords.ts", 14 | "./src/examples", 15 | "./scripts", 16 | "./build", 17 | "./dist" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /media/signatures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ax-llm/ax/8b26b7e43ca1221e8cfd180704f9e879ab52c314/media/signatures.png -------------------------------------------------------------------------------- /media/tune-prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ax-llm/ax/8b26b7e43ca1221e8cfd180704f9e879ab52c314/media/tune-prompt.png -------------------------------------------------------------------------------- /scripts/clean.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import process from 'process'; 3 | 4 | import fs from 'fs-extra'; 5 | 6 | process.argv.slice(1).map((fpath) => { 7 | const packagePath = process.cwd(); 8 | const targetPath = path.join(packagePath, fpath); 9 | if (fs.existsSync(targetPath)) { 10 | console.log(`Cleaning folder ${targetPath}`); 11 | fs.rmdirSync(targetPath, { recursive: true }); 12 | } 13 | }); 14 | 15 | process.exit(0); 16 | -------------------------------------------------------------------------------- /scripts/postbuild.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | 3 | import fs from 'fs-extra'; 4 | 5 | // eslint-disable-next-line no-undef 6 | const packagePath = process.cwd(); 7 | const buildPath = path.join(packagePath, './dist'); 8 | 9 | const packageJsonData = await fs.readFile(path.resolve(packagePath, './package.json'), 'utf8'); 10 | const packageJson = JSON.parse(packageJsonData); 11 | 12 | // Modify the package.json object 13 | packageJson.main = './index.cjs'; 14 | packageJson.module = './index.js'; 15 | packageJson.types = './index.d.ts'; 16 | packageJson.exports = { 17 | ".": { 18 | "import": "./index.js", 19 | "require": "./index.cjs" 20 | }, 21 | "./*": { 22 | "import": "./*.js", 23 | "require": "./*.cjs" 24 | } 25 | }; 26 | 27 | // Remove devDependencies and scripts 28 | delete packageJson.devDependencies; 29 | delete packageJson.scripts; 30 | 31 | // Write the modified package.json to the build folder 32 | await fs.writeJson(path.resolve(buildPath, './package.json'), packageJson, { spaces: 2 }); 33 | 34 | console.log('package.json has been modified and copied to the build folder.'); -------------------------------------------------------------------------------- /src/ai-sdk-provider/.prettierignore: -------------------------------------------------------------------------------- 1 | # Package files are formatted by package managers 2 | package.json 3 | package-lock.json 4 | yarn.lock 5 | pnpm-lock.yaml 6 | 7 | # Build outputs and distributions 8 | dist 9 | build 10 | 11 | # Generated indexes 12 | index.ts 13 | 14 | # Dependencies 15 | node_modules 16 | .pnpm-store 17 | 18 | # Documentation 19 | docs 20 | 21 | # Cache directories 22 | .cache 23 | .temp -------------------------------------------------------------------------------- /src/ai-sdk-provider/.release-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "npm": { 3 | "publish": false 4 | }, 5 | "git": false, 6 | "plugins": { 7 | "@release-it/bumper": { 8 | "out": [ 9 | { 10 | "file": "../../package.json", 11 | "path": ["version"] 12 | } 13 | ] 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/ai-sdk-provider/index.test.ts: -------------------------------------------------------------------------------- 1 | // import { describe, expect, it } from 'vitest' 2 | 3 | // import { AxAgentProvider, AxAIProvider } from './index.js' 4 | 5 | // describe('AxAgentProvider', () => { 6 | // it('should be defined', () => { 7 | // expect(AxAgentProvider).toBeDefined() 8 | // }) 9 | 10 | // it('should create an instance without errors', () => { 11 | // const instance = new AxAgentProvider({ 12 | // agent: { 13 | // name: 'test', 14 | // description: 'test', 15 | // functions: [], 16 | // }, 17 | // }) 18 | // expect(instance).toBeInstanceOf(AxAgentProvider) 19 | // }) 20 | 21 | // // Add more tests for specific functionalities or methods if they exist. 22 | // }) 23 | 24 | // describe('AxAIProvider', () => { 25 | // it('should be defined', () => { 26 | // expect(AxAIProvider).toBeDefined() 27 | // }) 28 | 29 | // it('should create an instance without errors', () => { 30 | // const instance = new AxAIProvider({ 31 | // ai: { 32 | // name: 'test', 33 | // description: 'test', 34 | // functions: [], 35 | // }, 36 | // }) 37 | // expect(instance).toBeInstanceOf(AxAIProvider) 38 | // }) 39 | 40 | // // Add more tests for additional functionalities or methods as needed. 41 | // }) 42 | -------------------------------------------------------------------------------- /src/ai-sdk-provider/index.ts: -------------------------------------------------------------------------------- 1 | import { AxAgentProvider } from './provider.js' 2 | import { AxAIProvider } from './provider.js' 3 | 4 | export { AxAgentProvider, AxAIProvider } 5 | -------------------------------------------------------------------------------- /src/ai-sdk-provider/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ax-llm/ax-ai-sdk-provider", 3 | "version": "11.0.49", 4 | "type": "module", 5 | "description": "Ax AI SDK Provider for the Vercel AI SDK", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/ax-llm/ax.git" 9 | }, 10 | "publishConfig": { 11 | "access": "public" 12 | }, 13 | "license": "Apache-2.0", 14 | "keywords": [], 15 | "scripts": { 16 | "dev": "tsup --watch", 17 | "build": "tsup", 18 | "clean": "rm -rf dist", 19 | "test": "run-s test:*", 20 | "test:type-check": "tsc --noEmit", 21 | "test:lint": "eslint", 22 | "test:format": "prettier --check \"**/*.{ts,json,md}\"", 23 | "fix": "run-s fix:*", 24 | "fix:lint": "eslint --fix", 25 | "fix:format": "prettier --write \"**/*.{ts,json,md}\"", 26 | "coverage": "c8 ava", 27 | "prepare": "husky install", 28 | "tsx": "node --env-file=.env --import=tsx", 29 | "release": "release-it", 30 | "publish": "npm run build && cd dist && npm publish", 31 | "postbuild": "node ../../scripts/postbuild.js" 32 | }, 33 | "dependencies": { 34 | "@ai-sdk/provider-utils": "^2.0.7 ", 35 | "@ax-llm/ax": "11.0.49", 36 | "ai": "^4.0.33", 37 | "zod": "^3.23.8" 38 | }, 39 | "bugs": { 40 | "url": "https://github.com/@ax-llm/ax/issues" 41 | }, 42 | "homepage": "https://github.com/@ax-llm/ax#readme", 43 | "author": "Vikram ", 44 | "devDependencies": { 45 | "@types/react": "^19.0.5" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/ai-sdk-provider/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tsconfig.json"] 3 | } 4 | -------------------------------------------------------------------------------- /src/ai-sdk-provider/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup' 2 | 3 | export default defineConfig({ 4 | entry: ['index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | splitting: false, 8 | clean: true, 9 | sourcemap: true, 10 | minify: false, 11 | }) 12 | -------------------------------------------------------------------------------- /src/ai-sdk-provider/util.ts: -------------------------------------------------------------------------------- 1 | import type { AxFunctionJSONSchema } from '@ax-llm/ax/index.js' 2 | import { z } from 'zod' 3 | 4 | type AnyZod = 5 | | z.AnyZodObject 6 | | z.ZodString 7 | | z.ZodNumber 8 | | z.ZodBoolean 9 | | z.ZodArray 10 | | z.ZodOptional 11 | 12 | export function convertToZodSchema( 13 | jsonSchema: Readonly 14 | ): AnyZod { 15 | const { type, properties, required, items } = jsonSchema 16 | 17 | switch (type) { 18 | case 'string': 19 | return z.string() 20 | case 'number': 21 | return z.number() 22 | case 'boolean': 23 | return z.boolean() 24 | case 'array': 25 | if (!items) { 26 | throw new Error("Array type must have 'items' property.") 27 | } 28 | return z.array(convertToZodSchema(items)) 29 | case 'object': { 30 | if (!properties) { 31 | throw new Error("Object type must have 'properties' property.") 32 | } 33 | const shape: Record = {} 34 | 35 | for (const [key, value] of Object.entries(properties)) { 36 | const schema = convertToZodSchema(value) 37 | 38 | let val = required?.includes(key) ? schema : schema.optional() 39 | val = value.description ? val.describe(value.description) : val 40 | 41 | shape[key] = val 42 | } 43 | return z.object(shape) 44 | } 45 | default: 46 | throw new Error(`Unsupported type: ${type}`) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/ax/.prettierignore: -------------------------------------------------------------------------------- 1 | # Package files are formatted by package managers 2 | package.json 3 | package-lock.json 4 | yarn.lock 5 | pnpm-lock.yaml 6 | 7 | # Build outputs and distributions 8 | dist 9 | build 10 | 11 | # Generated indexes 12 | index.ts 13 | 14 | # Dependencies 15 | node_modules 16 | .pnpm-store 17 | 18 | # Documentation 19 | docs 20 | 21 | # Cache directories 22 | .cache 23 | .temp -------------------------------------------------------------------------------- /src/ax/.release-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "npm": { 3 | "publish": false 4 | }, 5 | "git": false, 6 | "plugins": { 7 | "@release-it/bumper": { 8 | "out": [ 9 | { 10 | "file": "../../package.json", 11 | "path": ["version"] 12 | }, 13 | { 14 | "file": "../examples/package.json", 15 | "path": ["dependencies.@ax-llm/ax"] 16 | }, 17 | { 18 | "file": "../ai-sdk-provider/package.json", 19 | "path": ["dependencies.@ax-llm/ax"] 20 | } 21 | ] 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ax/ai/anthropic/info.ts: -------------------------------------------------------------------------------- 1 | import type { AxModelInfo } from '../types.js' 2 | 3 | import { AxAIAnthropicModel } from './types.js' 4 | 5 | export const axModelInfoAnthropic: AxModelInfo[] = [ 6 | // 35 7 | { 8 | name: AxAIAnthropicModel.Claude35Sonnet, 9 | currency: 'usd', 10 | promptTokenCostPer1M: 3.0, 11 | completionTokenCostPer1M: 15.0, 12 | }, 13 | { 14 | name: AxAIAnthropicModel.Claude35Haiku, 15 | currency: 'usd', 16 | promptTokenCostPer1M: 0.8, 17 | completionTokenCostPer1M: 4.0, 18 | }, 19 | // 3 20 | { 21 | name: AxAIAnthropicModel.Claude3Opus, 22 | currency: 'usd', 23 | promptTokenCostPer1M: 15.0, 24 | completionTokenCostPer1M: 75.0, 25 | }, 26 | { 27 | name: AxAIAnthropicModel.Claude3Sonnet, 28 | currency: 'usd', 29 | promptTokenCostPer1M: 3.0, 30 | completionTokenCostPer1M: 15.0, 31 | }, 32 | { 33 | name: AxAIAnthropicModel.Claude3Haiku, 34 | currency: 'usd', 35 | promptTokenCostPer1M: 0.25, 36 | completionTokenCostPer1M: 1.25, 37 | }, 38 | // 21 39 | { 40 | name: AxAIAnthropicModel.Claude21, 41 | currency: 'usd', 42 | promptTokenCostPer1M: 8.0, 43 | completionTokenCostPer1M: 25, 44 | }, 45 | { 46 | name: AxAIAnthropicModel.ClaudeInstant12, 47 | currency: 'usd', 48 | promptTokenCostPer1M: 0.8, 49 | completionTokenCostPer1M: 2.24, 50 | }, 51 | ] 52 | -------------------------------------------------------------------------------- /src/ax/ai/cohere/info.ts: -------------------------------------------------------------------------------- 1 | import type { AxModelInfo } from '../types.js' 2 | 3 | import { AxAICohereEmbedModel, AxAICohereModel } from './types.js' 4 | 5 | export const axModelInfoCohere: AxModelInfo[] = [ 6 | { 7 | name: AxAICohereModel.CommandRPlus, 8 | currency: 'usd', 9 | promptTokenCostPer1M: 3.0, 10 | completionTokenCostPer1M: 15, 11 | }, 12 | { 13 | name: AxAICohereModel.CommandR, 14 | currency: 'usd', 15 | promptTokenCostPer1M: 0.5, 16 | completionTokenCostPer1M: 1.5, 17 | }, 18 | { 19 | name: AxAICohereModel.Command, 20 | currency: 'usd', 21 | promptTokenCostPer1M: 0.5, 22 | completionTokenCostPer1M: 1.5, 23 | }, 24 | { 25 | name: AxAICohereModel.CommandLight, 26 | currency: 'usd', 27 | promptTokenCostPer1M: 0.3, 28 | completionTokenCostPer1M: 0.6, 29 | }, 30 | { 31 | name: AxAICohereEmbedModel.EmbedEnglishLightV30, 32 | currency: 'usd', 33 | promptTokenCostPer1M: 0.1, 34 | completionTokenCostPer1M: 0.1, 35 | }, 36 | { 37 | name: AxAICohereEmbedModel.EmbedEnglishV30, 38 | currency: 'usd', 39 | promptTokenCostPer1M: 0.1, 40 | completionTokenCostPer1M: 0.1, 41 | }, 42 | { 43 | name: AxAICohereEmbedModel.EmbedMultiLingualV30, 44 | currency: 'usd', 45 | promptTokenCostPer1M: 0.1, 46 | completionTokenCostPer1M: 0.1, 47 | }, 48 | { 49 | name: AxAICohereEmbedModel.EmbedMultiLingualLightV30, 50 | currency: 'usd', 51 | promptTokenCostPer1M: 0.1, 52 | completionTokenCostPer1M: 0.1, 53 | }, 54 | ] 55 | -------------------------------------------------------------------------------- /src/ax/ai/deepseek/info.ts: -------------------------------------------------------------------------------- 1 | import type { AxModelInfo } from '../types.js' 2 | 3 | import { AxAIDeepSeekModel } from './types.js' 4 | 5 | export const axModelInfoDeepSeek: AxModelInfo[] = [ 6 | { 7 | name: AxAIDeepSeekModel.DeepSeekChat, 8 | currency: 'USD', 9 | promptTokenCostPer1M: 0.27, 10 | completionTokenCostPer1M: 1.1, 11 | }, 12 | { 13 | name: AxAIDeepSeekModel.DeepSeekReasoner, 14 | currency: 'USD', 15 | promptTokenCostPer1M: 0.55, 16 | completionTokenCostPer1M: 2.19, 17 | }, 18 | ] 19 | -------------------------------------------------------------------------------- /src/ax/ai/deepseek/types.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * DeepSeek: Models for text generation 3 | */ 4 | export enum AxAIDeepSeekModel { 5 | DeepSeekChat = 'deepseek-chat', 6 | DeepSeekCoder = 'deepseek-coder', 7 | DeepSeekReasoner = 'deepseek-reasoner', 8 | } 9 | -------------------------------------------------------------------------------- /src/ax/ai/google-vertex/auth.ts: -------------------------------------------------------------------------------- 1 | import { GoogleAuth } from 'google-auth-library' 2 | import type { 3 | GoogleAuthOptions, 4 | JSONClient, 5 | } from 'google-auth-library/build/src/auth/googleauth.js' 6 | 7 | /** 8 | * This class is used to authenticate with the Google Vertex AI API. 9 | */ 10 | export class GoogleVertexAuth { 11 | private auth: GoogleAuth 12 | private client?: JSONClient 13 | 14 | constructor(config: GoogleAuthOptions = {}) { 15 | this.auth = new GoogleAuth({ 16 | scopes: ['https://www.googleapis.com/auth/cloud-platform'], 17 | ...config, 18 | }) 19 | } 20 | 21 | async getAuthenticatedClient() { 22 | if (!this.client) { 23 | this.client = (await this.auth.getClient()) as JSONClient 24 | } 25 | return this.client 26 | } 27 | 28 | async getAccessToken() { 29 | const client = await this.getAuthenticatedClient() 30 | const response = await client.getAccessToken() 31 | if (!response.token) { 32 | throw new Error('Failed to obtain access token') 33 | } 34 | return response.token 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/ax/ai/groq/info.ts: -------------------------------------------------------------------------------- 1 | import type { AxModelInfo } from '../types.js' 2 | 3 | import { AxAIGroqModel } from './types.js' 4 | 5 | /** 6 | * AxAIGroq: Model information 7 | */ 8 | export const axModelInfoGroq: AxModelInfo[] = [ 9 | { 10 | name: AxAIGroqModel.Gemma2_9B, 11 | currency: 'usd', 12 | characterIsToken: true, 13 | promptTokenCostPer1M: 0.2, 14 | completionTokenCostPer1M: 0.2, 15 | }, 16 | { 17 | name: AxAIGroqModel.Llama33_70B, 18 | currency: 'usd', 19 | characterIsToken: true, 20 | promptTokenCostPer1M: 0.59, 21 | completionTokenCostPer1M: 0.79, 22 | }, 23 | { 24 | name: AxAIGroqModel.Llama3_8B, 25 | currency: 'usd', 26 | characterIsToken: true, 27 | promptTokenCostPer1M: 0.05, 28 | completionTokenCostPer1M: 0.08, 29 | }, 30 | { 31 | name: AxAIGroqModel.Mixtral_8x7B, 32 | currency: 'usd', 33 | characterIsToken: true, 34 | promptTokenCostPer1M: 0.24, 35 | completionTokenCostPer1M: 0.24, 36 | }, 37 | ] 38 | -------------------------------------------------------------------------------- /src/ax/ai/groq/types.ts: -------------------------------------------------------------------------------- 1 | export enum AxAIGroqModel { 2 | Llama3_8B = 'llama3-8b-8192', 3 | Llama33_70B = 'llama-3.3-70b-versatile', 4 | Mixtral_8x7B = 'mixtral-8x7b-32768', 5 | Gemma2_9B = 'gemma2-9b-it', 6 | } 7 | -------------------------------------------------------------------------------- /src/ax/ai/huggingface/info.ts: -------------------------------------------------------------------------------- 1 | import type { AxModelInfo } from '../types.js' 2 | 3 | /** 4 | * HuggingFace: Model information 5 | */ 6 | export const axModelInfoHuggingFace: AxModelInfo[] = [] 7 | -------------------------------------------------------------------------------- /src/ax/ai/huggingface/types.ts: -------------------------------------------------------------------------------- 1 | import type { AxModelConfig } from '../types.js' 2 | 3 | export enum AxAIHuggingFaceModel { 4 | MetaLlama270BChatHF = 'meta-llama/Llama-2-70b-chat-hf', 5 | } 6 | 7 | export type AxAIHuggingFaceConfig = AxModelConfig & { 8 | model: AxAIHuggingFaceModel 9 | returnFullText?: boolean 10 | doSample?: boolean 11 | maxTime?: number 12 | useCache?: boolean 13 | waitForModel?: boolean 14 | } 15 | 16 | export type AxAIHuggingFaceRequest = { 17 | model: AxAIHuggingFaceModel 18 | inputs: string 19 | parameters: { 20 | max_new_tokens?: number 21 | repetition_penalty?: number 22 | temperature?: number 23 | top_p?: number 24 | top_k?: number 25 | return_full_text?: boolean 26 | num_return_sequences?: number 27 | do_sample?: boolean 28 | max_time?: number 29 | } 30 | options?: { 31 | use_cache?: boolean 32 | wait_for_model?: boolean 33 | } 34 | } 35 | 36 | export type AxAIHuggingFaceResponse = { 37 | generated_text: string 38 | } 39 | -------------------------------------------------------------------------------- /src/ax/ai/mistral/info.ts: -------------------------------------------------------------------------------- 1 | // cspell:ignore mistral, mixtral, codestral, nemo 2 | 3 | import type { AxModelInfo } from '../types.js' 4 | 5 | import { AxAIMistralModel } from './types.js' 6 | 7 | export const axModelInfoMistral: AxModelInfo[] = [ 8 | { 9 | name: AxAIMistralModel.Mistral7B, 10 | currency: 'USD', 11 | promptTokenCostPer1M: 0.25, 12 | completionTokenCostPer1M: 0.25, 13 | }, 14 | { 15 | name: AxAIMistralModel.Mistral8x7B, 16 | currency: 'USD', 17 | promptTokenCostPer1M: 0.7, 18 | completionTokenCostPer1M: 0.7, 19 | }, 20 | { 21 | name: AxAIMistralModel.MistralNemo, 22 | currency: 'USD', 23 | promptTokenCostPer1M: 0.15, 24 | completionTokenCostPer1M: 0.15, 25 | }, 26 | { 27 | name: AxAIMistralModel.MistralSmall, 28 | currency: 'USD', 29 | promptTokenCostPer1M: 0.2, 30 | completionTokenCostPer1M: 0.6, 31 | }, 32 | { 33 | name: AxAIMistralModel.MistralLarge, 34 | currency: 'USD', 35 | promptTokenCostPer1M: 2, 36 | completionTokenCostPer1M: 6, 37 | }, 38 | { 39 | name: AxAIMistralModel.Codestral, 40 | currency: 'USD', 41 | promptTokenCostPer1M: 0.2, 42 | completionTokenCostPer1M: 0.6, 43 | }, 44 | { 45 | name: AxAIMistralModel.OpenCodestralMamba, 46 | currency: 'USD', 47 | promptTokenCostPer1M: 0.25, 48 | completionTokenCostPer1M: 0.25, 49 | }, 50 | { 51 | name: AxAIMistralModel.OpenMistralNemo, 52 | currency: 'USD', 53 | promptTokenCostPer1M: 0.3, 54 | completionTokenCostPer1M: 0.3, 55 | }, 56 | ] 57 | -------------------------------------------------------------------------------- /src/ax/ai/mistral/types.ts: -------------------------------------------------------------------------------- 1 | // cspell:ignore mistral, mixtral, codestral, nemo 2 | 3 | export enum AxAIMistralModel { 4 | Mistral7B = 'open-mistral-7b', 5 | Mistral8x7B = 'open-mixtral-8x7b', 6 | MistralSmall = 'mistral-small-latest', 7 | MistralNemo = 'mistral-nemo-latest', 8 | MistralLarge = 'mistral-large-latest', 9 | Codestral = 'codestral-latest', 10 | OpenCodestralMamba = 'open-codestral-mamba', 11 | OpenMistralNemo = 'open-mistral-nemo-latest', 12 | } 13 | 14 | export enum AxAIMistralEmbedModels { 15 | MistralEmbed = 'mistral-embed', 16 | } 17 | -------------------------------------------------------------------------------- /src/ax/ai/ollama/api.ts: -------------------------------------------------------------------------------- 1 | import { 2 | axBaseAIDefaultConfig, 3 | axBaseAIDefaultCreativeConfig, 4 | } from '../base.js' 5 | import { type AxAIOpenAIArgs, AxAIOpenAIBase } from '../openai/api.js' 6 | import type { AxAIOpenAIConfig } from '../openai/types.js' 7 | 8 | export type AxAIOllamaAIConfig = AxAIOpenAIConfig 9 | 10 | export const axAIOllamaDefaultConfig = (): AxAIOllamaAIConfig => 11 | structuredClone({ 12 | ...axBaseAIDefaultConfig(), 13 | model: 'nous-hermes2', 14 | embedModel: 'all-minilm', 15 | }) 16 | 17 | export const axAIOllamaDefaultCreativeConfig = (): AxAIOllamaAIConfig => 18 | structuredClone({ 19 | ...axBaseAIDefaultCreativeConfig(), 20 | model: 'nous-hermes2', 21 | embedModel: 'all-minilm', 22 | }) 23 | 24 | export type AxAIOllamaArgs = AxAIOpenAIArgs<'ollama', string, string> & { 25 | model?: string 26 | embedModel?: string 27 | url?: string 28 | } 29 | 30 | /** 31 | * OllamaAI: AI Service 32 | */ 33 | export class AxAIOllama extends AxAIOpenAIBase { 34 | constructor({ 35 | apiKey = 'not-set', 36 | url = 'http://localhost:11434/v1', 37 | config, 38 | options, 39 | models, 40 | }: Readonly>) { 41 | const _config = { 42 | ...axAIOllamaDefaultConfig(), 43 | ...config, 44 | } 45 | super({ 46 | apiKey, 47 | options, 48 | config: _config, 49 | apiURL: url, 50 | models, 51 | modelInfo: [], 52 | supportFor: { 53 | functions: true, 54 | streaming: true, 55 | hasThinkingBudget: false, 56 | hasShowThoughts: false, 57 | }, 58 | }) 59 | 60 | super.setName('Ollama') 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/ax/ai/reka/info.ts: -------------------------------------------------------------------------------- 1 | import type { AxModelInfo } from '../types.js' 2 | 3 | import { AxAIRekaModel } from './types.js' 4 | /** 5 | * OpenAI: Model information 6 | */ 7 | export const axModelInfoReka: AxModelInfo[] = [ 8 | { 9 | name: AxAIRekaModel.RekaCore, 10 | currency: 'usd', 11 | promptTokenCostPer1M: 3, 12 | completionTokenCostPer1M: 15, 13 | }, 14 | { 15 | name: AxAIRekaModel.RekaFlash, 16 | currency: 'usd', 17 | promptTokenCostPer1M: 0.8, 18 | completionTokenCostPer1M: 2, 19 | }, 20 | { 21 | name: AxAIRekaModel.RekaEdge, 22 | currency: 'usd', 23 | promptTokenCostPer1M: 0.4, 24 | completionTokenCostPer1M: 1, 25 | }, 26 | ] 27 | -------------------------------------------------------------------------------- /src/ax/ai/together/api.ts: -------------------------------------------------------------------------------- 1 | import { axBaseAIDefaultConfig } from '../base.js' 2 | import { type AxAIOpenAIArgs, AxAIOpenAIBase } from '../openai/api.js' 3 | import type { AxAIOpenAIConfig } from '../openai/types.js' 4 | 5 | import { axModelInfoTogether } from './info.js' 6 | 7 | type TogetherAIConfig = AxAIOpenAIConfig 8 | 9 | export const axAITogetherDefaultConfig = (): TogetherAIConfig => 10 | structuredClone({ 11 | // cspell:disable-next-line 12 | model: 'mistralai/Mixtral-8x7B-Instruct-v0.1', 13 | ...axBaseAIDefaultConfig(), 14 | }) 15 | 16 | export type AxAITogetherArgs = AxAIOpenAIArgs<'together', string, unknown> 17 | 18 | export class AxAITogether extends AxAIOpenAIBase { 19 | constructor({ 20 | apiKey, 21 | config, 22 | options, 23 | models, 24 | modelInfo, 25 | }: Readonly>) { 26 | if (!apiKey || apiKey === '') { 27 | throw new Error('Together API key not set') 28 | } 29 | const _config = { 30 | ...axAITogetherDefaultConfig(), 31 | ...config, 32 | } 33 | 34 | modelInfo = [...axModelInfoTogether, ...(modelInfo ?? [])] 35 | 36 | const supportFor = { 37 | functions: true, 38 | streaming: true, 39 | hasThinkingBudget: false, 40 | hasShowThoughts: false, 41 | } 42 | 43 | super({ 44 | apiKey, 45 | config: _config, 46 | options, 47 | apiURL: 'https://api.together.xyz/v1', 48 | modelInfo, 49 | models, 50 | supportFor, 51 | }) 52 | 53 | super.setName('Together') 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/ax/ai/together/info.ts: -------------------------------------------------------------------------------- 1 | import type { AxModelInfo } from '../types.js' 2 | 3 | export const axModelInfoTogether: AxModelInfo[] = [] 4 | -------------------------------------------------------------------------------- /src/ax/ai/x-grok/info.ts: -------------------------------------------------------------------------------- 1 | // cspell:ignore grok 2 | 3 | import type { AxModelInfo } from '../types.js' 4 | 5 | import { AxAIGrokModel } from './types.js' 6 | 7 | export const axModelInfoGrok: AxModelInfo[] = [ 8 | { 9 | name: AxAIGrokModel.Grok3, 10 | currency: 'USD', 11 | promptTokenCostPer1M: 3.0, 12 | completionTokenCostPer1M: 15.0, 13 | }, 14 | { 15 | name: AxAIGrokModel.Grok3Mini, 16 | currency: 'USD', 17 | promptTokenCostPer1M: 0.3, 18 | completionTokenCostPer1M: 0.5, 19 | hasThinkingBudget: true, 20 | }, 21 | { 22 | name: AxAIGrokModel.Grok3Fast, 23 | currency: 'USD', 24 | promptTokenCostPer1M: 5.0, 25 | completionTokenCostPer1M: 25.0, 26 | }, 27 | { 28 | name: AxAIGrokModel.Grok3MiniFast, 29 | currency: 'USD', 30 | promptTokenCostPer1M: 0.6, 31 | completionTokenCostPer1M: 4.0, 32 | hasThinkingBudget: true, 33 | }, 34 | ] 35 | -------------------------------------------------------------------------------- /src/ax/ai/x-grok/types.ts: -------------------------------------------------------------------------------- 1 | // cspell:ignore grok 2 | 3 | export enum AxAIGrokModel { 4 | Grok3 = 'grok-3', 5 | Grok3Mini = 'grok-3-mini', 6 | Grok3Fast = 'grok-3-fast', 7 | Grok3MiniFast = 'grok-3-mini-fast', 8 | } 9 | 10 | export enum AxAIGrokEmbedModels { 11 | GrokEmbedSmall = 'grok-embed-small', // Placeholder, update if actual models are known 12 | } 13 | -------------------------------------------------------------------------------- /src/ax/db/types.ts: -------------------------------------------------------------------------------- 1 | // For upsert 2 | 3 | export type AxDBUpsertRequest = { 4 | id: string 5 | text?: string 6 | values?: readonly number[] 7 | metadata?: Record 8 | table: string 9 | namespace?: string 10 | } 11 | 12 | export type AxDBUpsertResponse = { 13 | ids: string[] 14 | } 15 | 16 | // For query 17 | export type AxDBQueryRequest = { 18 | id?: string 19 | text?: string 20 | values?: readonly number[] 21 | table: string 22 | columns?: string[] 23 | limit?: number 24 | namespace?: string 25 | } 26 | 27 | export type AxDBQueryResponse = { 28 | matches: { 29 | id: string 30 | score: number 31 | metadata?: Record 32 | table?: string 33 | }[] 34 | } 35 | 36 | export interface AxDBService extends AxDBQueryService { 37 | upsert( 38 | req: Readonly, 39 | update?: boolean 40 | ): Promise 41 | 42 | batchUpsert( 43 | batchReq: Readonly, 44 | update?: boolean 45 | ): Promise 46 | } 47 | 48 | export interface AxDBQueryService { 49 | query(req: Readonly): Promise 50 | } 51 | -------------------------------------------------------------------------------- /src/ax/db/wrap.ts: -------------------------------------------------------------------------------- 1 | import { AxDBCloudflare, type AxDBCloudflareArgs } from './cloudflare.js' 2 | import { AxDBMemory, type AxDBMemoryArgs } from './memory.js' 3 | import { AxDBPinecone, type AxDBPineconeArgs } from './pinecone.js' 4 | import type { 5 | AxDBQueryRequest, 6 | AxDBQueryResponse, 7 | AxDBService, 8 | AxDBUpsertRequest, 9 | AxDBUpsertResponse, 10 | } from './types.js' 11 | import { AxDBWeaviate, type AxDBWeaviateArgs } from './weaviate.js' 12 | 13 | export type AxDBArgs = 14 | | AxDBCloudflareArgs 15 | | AxDBPineconeArgs 16 | | AxDBWeaviateArgs 17 | | AxDBMemoryArgs 18 | 19 | export class AxDB implements AxDBService { 20 | private db: AxDBService 21 | constructor(args: Readonly) { 22 | switch (args.name) { 23 | case 'weaviate': 24 | this.db = new AxDBWeaviate(args) 25 | break 26 | case 'pinecone': 27 | this.db = new AxDBPinecone(args) 28 | break 29 | case 'cloudflare': 30 | this.db = new AxDBCloudflare(args) 31 | break 32 | case 'memory': 33 | this.db = new AxDBMemory(args) 34 | break 35 | default: 36 | throw new Error(`Unknown DB`) 37 | } 38 | } 39 | async upsert( 40 | req: Readonly, 41 | update?: boolean 42 | ): Promise { 43 | return await this.db.upsert(req, update) 44 | } 45 | 46 | async batchUpsert( 47 | batchReq: Readonly, 48 | update?: boolean 49 | ): Promise { 50 | return await this.db.batchUpsert(batchReq, update) 51 | } 52 | 53 | async query(req: Readonly): Promise { 54 | return await this.db.query(req) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/ax/docs/rewriter.ts: -------------------------------------------------------------------------------- 1 | import { 2 | AxGen, 3 | type AxGenOptions, 4 | type AxRewriteIn, 5 | type AxRewriteOut, 6 | } from '../index.js' 7 | 8 | export class AxDefaultQueryRewriter extends AxGen { 9 | constructor(options?: Readonly) { 10 | const signature = `"You are a query rewriter assistant tasked with rewriting a given query to improve its clarity, specificity, and relevance. Your role involves analyzing the query to identify any ambiguities, generalizations, or irrelevant information and then rephrasing it to make it more focused and precise. The rewritten query should be concise, easy to understand, and directly related to the original query. Output only the rewritten query." 11 | query: string -> rewrittenQuery: string` 12 | 13 | super(signature, options) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/ax/dsp/modelinfo.ts: -------------------------------------------------------------------------------- 1 | import type { AxAIInputModelList, AxModelInfo } from '../ai/types.js' 2 | 3 | interface GetModelInfoParams { 4 | model: TModel 5 | modelInfo: readonly AxModelInfo[] 6 | models?: AxAIInputModelList 7 | } 8 | 9 | export function getModelInfo({ 10 | model, 11 | modelInfo, 12 | models, 13 | }: Readonly< 14 | GetModelInfoParams 15 | >): Readonly | null { 16 | // First check if there's a mapping for this model 17 | const modelEntry = models?.find((v) => v.key === model) 18 | const mappedModel = 19 | modelEntry && 'model' in modelEntry 20 | ? (modelEntry.model as string) 21 | : (model as string) 22 | 23 | // Try exact match first 24 | const exactMatch = modelInfo.find((v) => v.name === model) 25 | if (exactMatch) return exactMatch 26 | 27 | // Handle normalization if no exact match 28 | const normalizedName = mappedModel 29 | // Remove vendor prefixes 30 | .replace(/^(anthropic\.|openai\.)/, '') 31 | // Remove various postfixes one by one, stopping after first match 32 | .replace(/-latest$/, '') 33 | .replace(/-\d{8}$/, '') // YYYYMMDD 34 | .replace(/-v\d+:\d+$/, '') // v2:0 35 | .replace(/@\d{8}$/, '') // @YYYYMMDD 36 | .replace(/-\d{2,}(-[a-zA-Z0-9-]+)?$/, '') // XX or XXXXX-something 37 | .replace(/-v\d+@\d{8}$/, '') // vX@YYYYMMDD 38 | .replace(/-v\d+$/, '') // Remove standalone version number 39 | 40 | // Try to find a match with the normalized name 41 | const normalizedMatch = modelInfo.find((v) => v.name === normalizedName) 42 | if (normalizedMatch) return normalizedMatch 43 | 44 | // Return default if no match found 45 | return null 46 | } 47 | -------------------------------------------------------------------------------- /src/ax/dsp/registry.ts: -------------------------------------------------------------------------------- 1 | export class AxInstanceRegistry { 2 | private reg: Set // To track keys for iteration 3 | 4 | constructor() { 5 | this.reg = new Set() 6 | } 7 | 8 | register(instance: T): void { 9 | this.reg.add(instance) 10 | } 11 | 12 | *[Symbol.iterator]() { 13 | for (const key of this.reg) { 14 | yield key 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/ax/mcp/transport.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | JSONRPCNotification, 3 | JSONRPCRequest, 4 | JSONRPCResponse, 5 | } from './types.js' 6 | 7 | export interface AxMCPTransport { 8 | /** 9 | * Sends a JSON-RPC request or notification and returns the response 10 | * @param message The JSON-RPC request or notification to send 11 | * @returns A Promise that resolves to the JSON-RPC response 12 | */ 13 | send( 14 | message: Readonly> 15 | ): Promise> 16 | 17 | /** 18 | * Sends a JSON-RPC notification 19 | * @param message The JSON-RPC notification to send 20 | */ 21 | sendNotification(message: Readonly): Promise 22 | 23 | /** 24 | * Connects to the transport if needed 25 | * This method is optional and only required for transports that need connection setup 26 | */ 27 | connect?(): Promise 28 | } 29 | -------------------------------------------------------------------------------- /src/ax/mcp/types.ts: -------------------------------------------------------------------------------- 1 | import type { AxFunctionJSONSchema } from '../ai/types.js' 2 | 3 | export interface JSONRPCRequest { 4 | jsonrpc: '2.0' 5 | id: string | number 6 | method: string 7 | params?: T 8 | } 9 | 10 | export interface JSONRPCSuccessResponse { 11 | jsonrpc: '2.0' 12 | id: string | number 13 | result: T 14 | } 15 | 16 | export interface JSONRPCErrorResponse { 17 | jsonrpc: '2.0' 18 | id: string | number 19 | error: { 20 | code: number 21 | message: string 22 | data?: unknown 23 | } 24 | } 25 | 26 | export type JSONRPCResponse = 27 | | JSONRPCSuccessResponse 28 | | JSONRPCErrorResponse 29 | 30 | export interface MCPInitializeParams { 31 | protocolVersion: string 32 | capabilities: Record 33 | clientInfo: { 34 | name: string 35 | version: string 36 | } 37 | } 38 | 39 | export interface MCPInitializeResult { 40 | protocolVersion: string 41 | capabilities: { 42 | tools?: unknown[] 43 | resources?: Record 44 | prompts?: unknown[] 45 | } 46 | serverInfo: { 47 | name: string 48 | version: string 49 | } 50 | } 51 | 52 | export interface MCPFunctionDescription { 53 | name: string 54 | description: string 55 | inputSchema: AxFunctionJSONSchema 56 | } 57 | 58 | export interface MCPToolsListResult { 59 | name: string 60 | description: string 61 | tools: MCPFunctionDescription[] 62 | } 63 | 64 | export interface JSONRPCNotification { 65 | jsonrpc: '2.0' 66 | method: string 67 | params?: Record 68 | } 69 | -------------------------------------------------------------------------------- /src/ax/mem/types.ts: -------------------------------------------------------------------------------- 1 | import type { AxChatRequest, AxChatResponseResult } from '../ai/types.js' 2 | 3 | export interface AxAIMemory { 4 | add( 5 | result: 6 | | Readonly 7 | | Readonly, 8 | sessionId?: string 9 | ): void 10 | addResult(result: Readonly, sessionId?: string): void 11 | updateResult( 12 | result: Readonly & { 13 | delta?: string 14 | }, 15 | sessionId?: string 16 | ): void 17 | 18 | history(sessionId?: string): AxChatRequest['chatPrompt'] 19 | reset(sessionId?: string): void 20 | 21 | getLast( 22 | sessionId?: string 23 | ): { chat: AxChatRequest['chatPrompt'][number]; tags?: string[] } | undefined 24 | 25 | addTag(name: string, sessionId?: string): void 26 | rewindToTag(name: string, sessionId?: string): AxChatRequest['chatPrompt'] 27 | } 28 | -------------------------------------------------------------------------------- /src/ax/prompts/cot.ts: -------------------------------------------------------------------------------- 1 | import { AxGen, type AxGenOptions } from '../dsp/generate.js' 2 | import type { AxGenIn, AxGenOut } from '../dsp/program.js' 3 | import { AxSignature } from '../dsp/sig.js' 4 | 5 | export class AxChainOfThought< 6 | IN extends AxGenIn = AxGenIn, 7 | OUT extends AxGenOut = AxGenOut, 8 | > extends AxGen { 9 | constructor( 10 | signature: Readonly, 11 | options?: Readonly 12 | ) { 13 | const sig = new AxSignature(signature) 14 | const description = `Let's work this out in a step by step way in order to ensure we have the right answer.` 15 | 16 | sig.setOutputFields([ 17 | { 18 | name: 'reason', 19 | description, 20 | }, 21 | ...sig.getOutputFields(), 22 | ]) 23 | 24 | super(sig, options) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/ax/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tsconfig.json"] 3 | } 4 | -------------------------------------------------------------------------------- /src/ax/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup' 2 | 3 | export default defineConfig({ 4 | entry: ['index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | splitting: false, 8 | clean: true, 9 | sourcemap: true, 10 | minify: false, 11 | }) 12 | -------------------------------------------------------------------------------- /src/ax/typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../typedoc.json"], 3 | "entryPoints": ["./index.ts"], 4 | "out": "../docs/src/content/docs/03-apidocs" 5 | } 6 | -------------------------------------------------------------------------------- /src/ax/util/log.ts: -------------------------------------------------------------------------------- 1 | export class ColorLog { 2 | // ANSI escape codes for different colors 3 | private readonly ANSI_WHITE_BRIGHT = '\x1b[97m' 4 | private readonly ANSI_GREEN_BRIGHT = '\x1b[92m' 5 | private readonly ANSI_BLUE_BRIGHT = '\x1b[94m' 6 | private readonly ANSI_YELLOW = '\x1b[93m' 7 | private readonly ANSI_RED = '\x1b[91m' 8 | private readonly ANSI_RESET = '\x1b[0m' 9 | 10 | // Method to wrap text with the specified ANSI color code 11 | private colorize(text: string, colorCode: string): string { 12 | return `${colorCode}${text}${this.ANSI_RESET}` 13 | } 14 | 15 | // Public methods to colorize text in various colors 16 | public whiteBright(text: string): string { 17 | return this.colorize(text, this.ANSI_WHITE_BRIGHT) 18 | } 19 | 20 | public greenBright(text: string): string { 21 | return this.colorize(text, this.ANSI_GREEN_BRIGHT) 22 | } 23 | 24 | public blueBright(text: string): string { 25 | return this.colorize(text, this.ANSI_BLUE_BRIGHT) 26 | } 27 | 28 | public yellow(text: string): string { 29 | return this.colorize(text, this.ANSI_YELLOW) 30 | } 31 | 32 | public red(text: string): string { 33 | return this.colorize(text, this.ANSI_RED) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/ax/util/other.ts: -------------------------------------------------------------------------------- 1 | export async function sleep(ms: number) { 2 | return new Promise((resolve) => setTimeout(resolve, ms)) 3 | } 4 | -------------------------------------------------------------------------------- /src/ax/util/stream.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type Transformer, 3 | TransformStream, 4 | type TransformStreamDefaultController, 5 | } from 'stream/web' 6 | 7 | export interface TextDecoderCommon { 8 | readonly encoding: string 9 | readonly fatal: boolean 10 | readonly ignoreBOM: boolean 11 | } 12 | 13 | class TextDecodeTransformer 14 | implements Transformer 15 | { 16 | private decoder 17 | 18 | constructor() { 19 | this.decoder = new TextDecoder() 20 | } 21 | 22 | transform( 23 | chunk: ArrayBuffer | Uint8Array, 24 | controller: TransformStreamDefaultController 25 | ) { 26 | if (!(chunk instanceof ArrayBuffer || ArrayBuffer.isView(chunk))) { 27 | throw new TypeError('Input data must be a BufferSource') 28 | } 29 | const text = this.decoder.decode(chunk, { stream: true }) 30 | if (text.length !== 0) { 31 | controller.enqueue(text) 32 | } 33 | } 34 | 35 | flush(controller: TransformStreamDefaultController) { 36 | const text = this.decoder.decode() 37 | if (text.length !== 0) { 38 | controller.enqueue(text) 39 | } 40 | } 41 | } 42 | 43 | export class TextDecoderStreamPolyfill extends TransformStream< 44 | ArrayBuffer | Uint8Array, 45 | string 46 | > { 47 | constructor() { 48 | super(new TextDecodeTransformer()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/ax/util/transform.ts: -------------------------------------------------------------------------------- 1 | import { 2 | type Transformer, 3 | TransformStream, 4 | type TransformStreamDefaultController, 5 | } from 'stream/web' 6 | 7 | class TypeTransformer implements Transformer { 8 | private buffer?: O[] 9 | private doneCallback?: (args0: readonly O[]) => Promise 10 | private transformFn: (arg0: I) => O 11 | 12 | constructor( 13 | transformFn: (arg0: I) => O, 14 | doneCallback?: (args0: readonly O[]) => Promise 15 | ) { 16 | this.transformFn = transformFn 17 | this.doneCallback = doneCallback 18 | this.buffer = doneCallback ? [] : undefined 19 | } 20 | 21 | async transform(obj: I, controller: TransformStreamDefaultController) { 22 | const val = this.transformFn(obj) 23 | if (val) { 24 | controller.enqueue(val) 25 | this.buffer?.push(val) 26 | } 27 | } 28 | 29 | async flush(controller: TransformStreamDefaultController) { 30 | await this.doneCallback?.(this.buffer ?? []) 31 | controller.terminate() 32 | } 33 | } 34 | 35 | export class RespTransformStream extends TransformStream { 36 | constructor( 37 | transformFn: (arg0: I) => O, 38 | doneCallback?: (args0: readonly O[]) => Promise 39 | ) { 40 | super(new TypeTransformer(transformFn, doneCallback)) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/docs/.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | 4 | # generated types 5 | .astro/ 6 | 7 | # dependencies 8 | node_modules/ 9 | 10 | # logs 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | 17 | # environment variables 18 | .env 19 | .env.production 20 | 21 | # macOS-specific files 22 | .DS_Store 23 | 24 | # api docs 25 | src/content/docs/apidocs* 26 | -------------------------------------------------------------------------------- /src/docs/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /src/docs/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/docs/astro.config.mjs: -------------------------------------------------------------------------------- 1 | import tailwind from "@astrojs/tailwind"; 2 | import { defineConfig } from 'astro/config'; 3 | 4 | // https://astro.build/config 5 | export default defineConfig({ 6 | integrations: [tailwind()], 7 | }); -------------------------------------------------------------------------------- /src/docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ax-llm/ax-docs", 3 | "type": "module", 4 | "scripts": { 5 | "dev": "astro dev", 6 | "start": "astro dev", 7 | "build": "astro check && astro build", 8 | "preview": "astro preview", 9 | "astro": "astro" 10 | }, 11 | "dependencies": { 12 | "@astrojs/check": "^0.9.4", 13 | "@astrojs/tailwind": "^6.0.1", 14 | "@tailwindcss/typography": "^0.5.16", 15 | "astro": "^5.5.4" 16 | }, 17 | "private": "true" 18 | } 19 | -------------------------------------------------------------------------------- /src/docs/public/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/docs/public/mattress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ax-llm/ax/8b26b7e43ca1221e8cfd180704f9e879ab52c314/src/docs/public/mattress.png -------------------------------------------------------------------------------- /src/docs/src/assets/ax-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ax-llm/ax/8b26b7e43ca1221e8cfd180704f9e879ab52c314/src/docs/src/assets/ax-logo.png -------------------------------------------------------------------------------- /src/docs/src/assets/mattress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ax-llm/ax/8b26b7e43ca1221e8cfd180704f9e879ab52c314/src/docs/src/assets/mattress.png -------------------------------------------------------------------------------- /src/docs/src/assets/spacy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ax-llm/ax/8b26b7e43ca1221e8cfd180704f9e879ab52c314/src/docs/src/assets/spacy.jpg -------------------------------------------------------------------------------- /src/docs/src/components/Footer.astro: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | 6 |
7 |
8 | Based on Stanford DSPy 9 | Machines as Agents™ 10 | TypeScript First 11 |
12 |
13 | -------------------------------------------------------------------------------- /src/docs/src/components/Header.astro: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | 6 |
7 |
8 |
9 |
AX AGENT FRAMEWORK
10 |
11 | TYPESCRIPT-FIRST LLM INFRASTRUCTURE 12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 21 |
22 |

Ax Framework

23 |
Build LLM-Powered Agents with TypeScript
24 |
25 |
26 | -------------------------------------------------------------------------------- /src/docs/src/content/config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection, z } from 'astro:content' 2 | 3 | export const collections = { 4 | docs: defineCollection({ 5 | schema: z.object({ 6 | title: z.string(), 7 | description: z.string().optional(), 8 | }), 9 | }), 10 | } 11 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/.gitignore: -------------------------------------------------------------------------------- 1 | 03-apidocs/* -------------------------------------------------------------------------------- /src/docs/src/content/docs/01-start/06-multi-modal.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Multi-modal DSPy 3 | description: Using multi-modal inputs like images and audio with DSPy pipelines and LLMs 4 | --- 5 | 6 | When using models like `GPT-4o` and `Gemini` that support multi-modal prompts, we support using image fields, and this works with the whole DSP pipeline. 7 | 8 | ```typescript 9 | const image = fs 10 | .readFileSync('./src/examples/assets/kitten.jpeg') 11 | .toString('base64'); 12 | 13 | const gen = new AxChainOfThought(`question, animalImage:image -> answer`); 14 | 15 | const res = await gen.forward(ai, { 16 | question: 'What family does this animal belong to?', 17 | animalImage: { mimeType: 'image/jpeg', data: image } 18 | }); 19 | ``` 20 | 21 | When using models like `gpt-4o-audio-preview` that support multi-modal prompts with audio support, we support using audio fields, and this works with the whole DSP pipeline. 22 | 23 | ```typescript 24 | const audio = fs 25 | .readFileSync('./src/examples/assets/comment.wav') 26 | .toString('base64'); 27 | 28 | const gen = new AxGen(`question, commentAudio:audio -> answer`); 29 | 30 | const res = await gen.forward(ai, { 31 | question: 'What family does this animal belong to?', 32 | commentAudio: { format: 'wav', data: audio } 33 | }); 34 | ``` -------------------------------------------------------------------------------- /src/docs/src/content/docs/01-start/08-mcp.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Model Context Protocol (MCP) 3 | description: Model Context Protocol (MCP), allowing your agents to access external tools, and resources through a standardized interface. 4 | --- 5 | 6 | Ax provides seamless integration with the Model Context Protocol (MCP), allowing your agents to access external tools, and resources through a standardized interface. 7 | 8 | ## Using AxMCPClient 9 | 10 | The `AxMCPClient` allows you to connect to any MCP-compatible server and use its capabilities within your Ax agents: 11 | 12 | ```typescript 13 | import { AxMCPClient, AxMCPStdioTransport } from '@ax-llm/ax' 14 | 15 | // Initialize an MCP client with a transport 16 | const transport = new AxMCPStdioTransport({ 17 | command: 'npx', 18 | args: ['-y', '@modelcontextprotocol/server-memory'], 19 | }) 20 | 21 | // Create the client with optional debug mode 22 | const client = new AxMCPClient(transport, { debug: true }) 23 | 24 | // Initialize the connection 25 | await client.init() 26 | 27 | // Use the client's functions in an agent 28 | const memoryAgent = new AxAgent({ 29 | name: 'MemoryAssistant', 30 | description: 'An assistant with persistent memory', 31 | signature: 'input, userId -> response', 32 | functions: [client], // Pass the client as a function provider 33 | }) 34 | 35 | // Or use the client with AxGen 36 | const memoryGen = new AxGen('input, userId -> response', { 37 | functions: [client] 38 | }) 39 | ``` -------------------------------------------------------------------------------- /src/docs/src/content/docs/01-start/10-vercel-ai-sdk.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vercel AI SDK Integration 3 | description: Learn how to integrate Ax with the Vercel AI SDK for building AI-powered applications using both the AI provider and Agent provider functionality. 4 | --- 5 | 6 | ```shell 7 | npm i @ax-llm/ax-ai-sdk-provider 8 | ``` 9 | 10 | Then use it with the AI SDK, you can either use the AI provider or the Agent Provider 11 | 12 | ```typescript 13 | const ai = new AxAI({ 14 | name: 'openai', 15 | apiKey: process.env['OPENAI_APIKEY'] ?? "", 16 | }); 17 | 18 | // Create a model using the provider 19 | const model = new AxAIProvider(ai); 20 | 21 | export const foodAgent = new AxAgent({ 22 | name: 'food-search', 23 | description: 24 | 'Use this agent to find restaurants based on what the customer wants', 25 | signature, 26 | functions 27 | }) 28 | 29 | // Get vercel ai sdk state 30 | const aiState = getMutableAIState() 31 | 32 | // Create an agent for a specific task 33 | const foodAgent = new AxAgentProvider(ai, { 34 | agent: foodAgent, 35 | updateState: (state) => { 36 | aiState.done({ ...aiState.get(), state }) 37 | }, 38 | generate: async ({ restaurant, priceRange }) => { 39 | return ( 40 | 41 |

{restaurant as string} {priceRange as string}

42 |
43 | ) 44 | } 45 | }) 46 | 47 | // Use with streamUI a critical part of building chat UIs in the AI SDK 48 | const result = await streamUI({ 49 | model, 50 | initial: , 51 | messages: [ 52 | // ... 53 | ], 54 | text: ({ content, done, delta }) => { 55 | // ... 56 | }, 57 | tools: { 58 | // @ts-ignore 59 | 'find-food': foodAgent, 60 | } 61 | }) 62 | ``` -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Class.AxApacheTika.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxApacheTika 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/tika.ts#L12 6 | 7 | ## Constructors 8 | 9 | 10 | 11 | ### new AxApacheTika() 12 | 13 | > **new AxApacheTika**(`args`?): [`AxApacheTika`](/api/#03-apidocs/classaxapachetika) 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/tika.ts#L16 16 | 17 | #### Parameters 18 | 19 | | Parameter | Type | 20 | | ------ | ------ | 21 | | `args`? | `Readonly`\<[`AxApacheTikaArgs`](/api/#03-apidocs/interfaceaxapachetikaargs)\> | 22 | 23 | #### Returns 24 | 25 | [`AxApacheTika`](/api/#03-apidocs/classaxapachetika) 26 | 27 | ## Methods 28 | 29 | 30 | 31 | ### convert() 32 | 33 | > **convert**(`files`, `options`?): `Promise`\<`string`[]\> 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/tika.ts#L54 36 | 37 | #### Parameters 38 | 39 | | Parameter | Type | 40 | | ------ | ------ | 41 | | `files` | `Readonly`\<`string`[] \| `Blob`[]\> | 42 | | `options`? | `Readonly`\<\{ `batchSize`: `number`; `format`: `"text"` \| `"html"`; \}\> | 43 | 44 | #### Returns 45 | 46 | `Promise`\<`string`[]\> 47 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Class.AxEmbeddingAdapter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxEmbeddingAdapter 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/embed.ts#L7 6 | 7 | ## Constructors 8 | 9 | 10 | 11 | ### new AxEmbeddingAdapter() 12 | 13 | > **new AxEmbeddingAdapter**(`__namedParameters`): [`AxEmbeddingAdapter`](/api/#03-apidocs/classaxembeddingadapter) 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/embed.ts#L19 16 | 17 | #### Parameters 18 | 19 | | Parameter | Type | 20 | | ------ | ------ | 21 | | `__namedParameters` | `Readonly`\<\{ `ai`: [`AxAIService`](/api/#03-apidocs/interfaceaxaiservice); `func`: (`args`, `extra`?) => `Promise`\<`unknown`\>; `info`: `Readonly`\<\{ `argumentDescription`: `string`; `description`: `string`; `name`: `string`; \}\>; \}\> | 22 | 23 | #### Returns 24 | 25 | [`AxEmbeddingAdapter`](/api/#03-apidocs/classaxembeddingadapter) 26 | 27 | ## Methods 28 | 29 | 30 | 31 | ### toFunction() 32 | 33 | > **toFunction**(): [`AxFunction`](/api/#03-apidocs/typealiasaxfunction) 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/embed.ts#L57 36 | 37 | #### Returns 38 | 39 | [`AxFunction`](/api/#03-apidocs/typealiasaxfunction) 40 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Class.AxFunctionProcessor.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxFunctionProcessor 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/functions.ts#L73 6 | 7 | ## Constructors 8 | 9 | 10 | 11 | ### new AxFunctionProcessor() 12 | 13 | > **new AxFunctionProcessor**(`funcList`): [`AxFunctionProcessor`](/api/#03-apidocs/classaxfunctionprocessor) 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/functions.ts#L76 16 | 17 | #### Parameters 18 | 19 | | Parameter | Type | 20 | | ------ | ------ | 21 | | `funcList` | readonly [`AxFunction`](/api/#03-apidocs/typealiasaxfunction)[] | 22 | 23 | #### Returns 24 | 25 | [`AxFunctionProcessor`](/api/#03-apidocs/classaxfunctionprocessor) 26 | 27 | ## Methods 28 | 29 | 30 | 31 | ### execute() 32 | 33 | > **execute**(`func`, `options`?): `Promise`\<`string`\> 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/functions.ts#L116 36 | 37 | #### Parameters 38 | 39 | | Parameter | Type | 40 | | ------ | ------ | 41 | | `func` | `Readonly`\<[`AxChatResponseFunctionCall`](/api/#03-apidocs/typealiasaxchatresponsefunctioncall)\> | 42 | | `options`? | `Readonly`\<[`AxAIServiceActionOptions`](/api/#03-apidocs/typealiasaxaiserviceactionoptions)\> | 43 | 44 | #### Returns 45 | 46 | `Promise`\<`string`\> 47 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Class.AxInstanceRegistry.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxInstanceRegistry 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/registry.ts#L1 6 | 7 | ## Type Parameters 8 | 9 | | Type Parameter | 10 | | ------ | 11 | | `T` | 12 | 13 | ## Constructors 14 | 15 | 16 | 17 | ### new AxInstanceRegistry() 18 | 19 | > **new AxInstanceRegistry**\<`T`\>(): [`AxInstanceRegistry`](/api/#03-apidocs/classaxinstanceregistry)\<`T`\> 20 | 21 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/registry.ts#L4 22 | 23 | #### Returns 24 | 25 | [`AxInstanceRegistry`](/api/#03-apidocs/classaxinstanceregistry)\<`T`\> 26 | 27 | ## Methods 28 | 29 | 30 | 31 | ### \[iterator\]() 32 | 33 | > **\[iterator\]**(): `Generator`\<`T`, `void`, `unknown`\> 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/registry.ts#L12 36 | 37 | #### Returns 38 | 39 | `Generator`\<`T`, `void`, `unknown`\> 40 | 41 | *** 42 | 43 | 44 | 45 | ### register() 46 | 47 | > **register**(`instance`): `void` 48 | 49 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/registry.ts#L8 50 | 51 | #### Parameters 52 | 53 | | Parameter | Type | 54 | | ------ | ------ | 55 | | `instance` | `T` | 56 | 57 | #### Returns 58 | 59 | `void` 60 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Class.AxJSInterpreter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxJSInterpreter 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L29 6 | 7 | ## Constructors 8 | 9 | 10 | 11 | ### new AxJSInterpreter() 12 | 13 | > **new AxJSInterpreter**(`__namedParameters`): [`AxJSInterpreter`](/api/#03-apidocs/classaxjsinterpreter) 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L32 16 | 17 | #### Parameters 18 | 19 | | Parameter | Type | 20 | | ------ | ------ | 21 | | `__namedParameters` | `undefined` \| `Readonly`\<\{ `permissions`: readonly [`AxJSInterpreterPermission`](/api/#03-apidocs/enumerationaxjsinterpreterpermission)[]; \}\> | 22 | 23 | #### Returns 24 | 25 | [`AxJSInterpreter`](/api/#03-apidocs/classaxjsinterpreter) 26 | 27 | ## Methods 28 | 29 | 30 | 31 | ### toFunction() 32 | 33 | > **toFunction**(): [`AxFunction`](/api/#03-apidocs/typealiasaxfunction) 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L67 36 | 37 | #### Returns 38 | 39 | [`AxFunction`](/api/#03-apidocs/typealiasaxfunction) 40 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Class.AxRateLimiterTokenUsage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRateLimiterTokenUsage 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/util/rate-limit.ts#L9 6 | 7 | ## Constructors 8 | 9 | 10 | 11 | ### new AxRateLimiterTokenUsage() 12 | 13 | > **new AxRateLimiterTokenUsage**(`maxTokens`, `refillRate`, `options`?): [`AxRateLimiterTokenUsage`](/api/#03-apidocs/classaxratelimitertokenusage) 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/util/rate-limit.ts#L16 16 | 17 | #### Parameters 18 | 19 | | Parameter | Type | 20 | | ------ | ------ | 21 | | `maxTokens` | `number` | 22 | | `refillRate` | `number` | 23 | | `options`? | `Readonly`\<[`AxRateLimiterTokenUsageOptions`](/api/#03-apidocs/interfaceaxratelimitertokenusageoptions)\> | 24 | 25 | #### Returns 26 | 27 | [`AxRateLimiterTokenUsage`](/api/#03-apidocs/classaxratelimitertokenusage) 28 | 29 | ## Methods 30 | 31 | 32 | 33 | ### acquire() 34 | 35 | > **acquire**(`tokens`): `Promise`\<`void`\> 36 | 37 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/util/rate-limit.ts#L56 38 | 39 | #### Parameters 40 | 41 | | Parameter | Type | 42 | | ------ | ------ | 43 | | `tokens` | `number` | 44 | 45 | #### Returns 46 | 47 | `Promise`\<`void`\> 48 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Class.AxRoute.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRoute 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/router.ts#L11 6 | 7 | ## Constructors 8 | 9 | 10 | 11 | ### new AxRoute() 12 | 13 | > **new AxRoute**(`name`, `context`): [`AxRoute`](/api/#03-apidocs/classaxroute) 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/router.ts#L15 16 | 17 | #### Parameters 18 | 19 | | Parameter | Type | 20 | | ------ | ------ | 21 | | `name` | `string` | 22 | | `context` | readonly `string`[] | 23 | 24 | #### Returns 25 | 26 | [`AxRoute`](/api/#03-apidocs/classaxroute) 27 | 28 | ## Methods 29 | 30 | 31 | 32 | ### getContext() 33 | 34 | > **getContext**(): readonly `string`[] 35 | 36 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/router.ts#L24 37 | 38 | #### Returns 39 | 40 | readonly `string`[] 41 | 42 | *** 43 | 44 | 45 | 46 | ### getName() 47 | 48 | > **getName**(): `string` 49 | 50 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/router.ts#L20 51 | 52 | #### Returns 53 | 54 | `string` 55 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Class.AxTestPrompt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxTestPrompt 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/evaluate.ts#L13 6 | 7 | ## Type Parameters 8 | 9 | | Type Parameter | Default type | 10 | | ------ | ------ | 11 | | `IN` *extends* [`AxGenIn`](/api/#03-apidocs/typealiasaxgenin) | [`AxGenIn`](/api/#03-apidocs/typealiasaxgenin) | 12 | | `OUT` *extends* [`AxGenOut`](/api/#03-apidocs/typealiasaxgenout) | [`AxGenOut`](/api/#03-apidocs/typealiasaxgenout) | 13 | 14 | ## Constructors 15 | 16 | 17 | 18 | ### new AxTestPrompt() 19 | 20 | > **new AxTestPrompt**\<`IN`, `OUT`\>(`__namedParameters`): [`AxTestPrompt`](/api/#03-apidocs/classaxtestprompt)\<`IN`, `OUT`\> 21 | 22 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/evaluate.ts#L21 23 | 24 | #### Parameters 25 | 26 | | Parameter | Type | 27 | | ------ | ------ | 28 | | `__namedParameters` | `Readonly`\<[`AxEvaluateArgs`](/api/#03-apidocs/typealiasaxevaluateargs)\<`IN`, `OUT`\>\> | 29 | 30 | #### Returns 31 | 32 | [`AxTestPrompt`](/api/#03-apidocs/classaxtestprompt)\<`IN`, `OUT`\> 33 | 34 | ## Methods 35 | 36 | 37 | 38 | ### run() 39 | 40 | > **run**(`metricFn`): `Promise`\<`void`\> 41 | 42 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/evaluate.ts#L34 43 | 44 | #### Parameters 45 | 46 | | Parameter | Type | 47 | | ------ | ------ | 48 | | `metricFn` | [`AxMetricFn`](/api/#03-apidocs/typealiasaxmetricfn) | 49 | 50 | #### Returns 51 | 52 | `Promise`\<`void`\> 53 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAICohereEmbedModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereEmbedModel 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L16 6 | 7 | Cohere: Models for use in embeddings 8 | 9 | ## Enumeration Members 10 | 11 | 12 | 13 | ### EmbedEnglishLightV30 14 | 15 | > **EmbedEnglishLightV30**: `"embed-english-light-v3.0"` 16 | 17 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L18 18 | 19 | *** 20 | 21 | 22 | 23 | ### EmbedEnglishV30 24 | 25 | > **EmbedEnglishV30**: `"embed-english-v3.0"` 26 | 27 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L17 28 | 29 | *** 30 | 31 | 32 | 33 | ### EmbedMultiLingualLightV30 34 | 35 | > **EmbedMultiLingualLightV30**: `"embed-multilingual-light-v3.0"` 36 | 37 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L20 38 | 39 | *** 40 | 41 | 42 | 43 | ### EmbedMultiLingualV30 44 | 45 | > **EmbedMultiLingualV30**: `"embed-multilingual-v3.0"` 46 | 47 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L19 48 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAICohereModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereModel 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L6 6 | 7 | Cohere: Models for text generation 8 | 9 | ## Enumeration Members 10 | 11 | 12 | 13 | ### Command 14 | 15 | > **Command**: `"command"` 16 | 17 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L9 18 | 19 | *** 20 | 21 | 22 | 23 | ### CommandLight 24 | 25 | > **CommandLight**: `"command-light"` 26 | 27 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L10 28 | 29 | *** 30 | 31 | 32 | 33 | ### CommandR 34 | 35 | > **CommandR**: `"command-r"` 36 | 37 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L8 38 | 39 | *** 40 | 41 | 42 | 43 | ### CommandRPlus 44 | 45 | > **CommandRPlus**: `"command-r-plus"` 46 | 47 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L7 48 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIDeepSeekModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIDeepSeekModel 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/deepseek/types.ts#L4 6 | 7 | DeepSeek: Models for text generation 8 | 9 | ## Enumeration Members 10 | 11 | 12 | 13 | ### DeepSeekChat 14 | 15 | > **DeepSeekChat**: `"deepseek-chat"` 16 | 17 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/deepseek/types.ts#L5 18 | 19 | *** 20 | 21 | 22 | 23 | ### DeepSeekCoder 24 | 25 | > **DeepSeekCoder**: `"deepseek-coder"` 26 | 27 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/deepseek/types.ts#L6 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIGoogleGeminiEmbedModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiEmbedModel 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L17 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### TextEmbedding004 12 | 13 | > **TextEmbedding004**: `"text-embedding-004"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L18 16 | 17 | *** 18 | 19 | 20 | 21 | ### TextEmbedding005 22 | 23 | > **TextEmbedding005**: `"text-embedding-005"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L19 26 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIGoogleGeminiSafetyCategory.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiSafetyCategory 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L22 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### HarmCategoryDangerousContent 12 | 13 | > **HarmCategoryDangerousContent**: `"HARM_CATEGORY_DANGEROUS_CONTENT"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L26 16 | 17 | *** 18 | 19 | 20 | 21 | ### HarmCategoryHarassment 22 | 23 | > **HarmCategoryHarassment**: `"HARM_CATEGORY_HARASSMENT"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L23 26 | 27 | *** 28 | 29 | 30 | 31 | ### HarmCategoryHateSpeech 32 | 33 | > **HarmCategoryHateSpeech**: `"HARM_CATEGORY_HATE_SPEECH"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L24 36 | 37 | *** 38 | 39 | 40 | 41 | ### HarmCategorySexuallyExplicit 42 | 43 | > **HarmCategorySexuallyExplicit**: `"HARM_CATEGORY_SEXUALLY_EXPLICIT"` 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L25 46 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIGoogleGeminiSafetyThreshold.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiSafetyThreshold 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L29 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### BlockDefault 12 | 13 | > **BlockDefault**: `"HARM_BLOCK_THRESHOLD_UNSPECIFIED"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L34 16 | 17 | *** 18 | 19 | 20 | 21 | ### BlockLowAndAbove 22 | 23 | > **BlockLowAndAbove**: `"BLOCK_LOW_AND_ABOVE"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L33 26 | 27 | *** 28 | 29 | 30 | 31 | ### BlockMediumAndAbove 32 | 33 | > **BlockMediumAndAbove**: `"BLOCK_MEDIUM_AND_ABOVE"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L32 36 | 37 | *** 38 | 39 | 40 | 41 | ### BlockNone 42 | 43 | > **BlockNone**: `"BLOCK_NONE"` 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L30 46 | 47 | *** 48 | 49 | 50 | 51 | ### BlockOnlyHigh 52 | 53 | > **BlockOnlyHigh**: `"BLOCK_ONLY_HIGH"` 54 | 55 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L31 56 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIGroqModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGroqModel 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/groq/types.ts#L1 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### Gemma2\_9B 12 | 13 | > **Gemma2\_9B**: `"gemma2-9b-it"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/groq/types.ts#L5 16 | 17 | *** 18 | 19 | 20 | 21 | ### Llama3\_8B 22 | 23 | > **Llama3\_8B**: `"llama3-8b-8192"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/groq/types.ts#L2 26 | 27 | *** 28 | 29 | 30 | 31 | ### Llama33\_70B 32 | 33 | > **Llama33\_70B**: `"llama-3.3-70b-versatile"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/groq/types.ts#L3 36 | 37 | *** 38 | 39 | 40 | 41 | ### Mixtral\_8x7B 42 | 43 | > **Mixtral\_8x7B**: `"mixtral-8x7b-32768"` 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/groq/types.ts#L4 46 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIHuggingFaceModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIHuggingFaceModel 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/types.ts#L3 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### MetaLlama270BChatHF 12 | 13 | > **MetaLlama270BChatHF**: `"meta-llama/Llama-2-70b-chat-hf"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/types.ts#L4 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIMistralEmbedModels.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIMistralEmbedModels 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/mistral/types.ts#L14 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### MistralEmbed 12 | 13 | > **MistralEmbed**: `"mistral-embed"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/mistral/types.ts#L15 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIOpenAIEmbedModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOpenAIEmbedModel 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L19 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### TextEmbedding3Large 12 | 13 | > **TextEmbedding3Large**: `"text-embedding-3-large"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L22 16 | 17 | *** 18 | 19 | 20 | 21 | ### TextEmbedding3Small 22 | 23 | > **TextEmbedding3Small**: `"text-embedding-3-small"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L21 26 | 27 | *** 28 | 29 | 30 | 31 | ### TextEmbeddingAda002 32 | 33 | > **TextEmbeddingAda002**: `"text-embedding-ada-002"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L20 36 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxAIRekaModel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIRekaModel 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L3 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### RekaCore 12 | 13 | > **RekaCore**: `"reka-core"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L4 16 | 17 | *** 18 | 19 | 20 | 21 | ### RekaEdge 22 | 23 | > **RekaEdge**: `"reka-edge"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L6 26 | 27 | *** 28 | 29 | 30 | 31 | ### RekaFlash 32 | 33 | > **RekaFlash**: `"reka-flash"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L5 36 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxJSInterpreterPermission.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxJSInterpreterPermission 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L11 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### CRYPTO 12 | 13 | > **CRYPTO**: `"crypto"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L15 16 | 17 | *** 18 | 19 | 20 | 21 | ### FS 22 | 23 | > **FS**: `"node:fs"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L12 26 | 27 | *** 28 | 29 | 30 | 31 | ### NET 32 | 33 | > **NET**: `"net"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L13 36 | 37 | *** 38 | 39 | 40 | 41 | ### OS 42 | 43 | > **OS**: `"os"` 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L14 46 | 47 | *** 48 | 49 | 50 | 51 | ### PROCESS 52 | 53 | > **PROCESS**: `"process"` 54 | 55 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/funcs/code.ts#L16 56 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxLLMRequestTypeValues.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxLLMRequestTypeValues 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L46 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### CHAT 12 | 13 | > **CHAT**: `"chat"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L48 16 | 17 | *** 18 | 19 | 20 | 21 | ### COMPLETION 22 | 23 | > **COMPLETION**: `"completion"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L47 26 | 27 | *** 28 | 29 | 30 | 31 | ### RERANK 32 | 33 | > **RERANK**: `"rerank"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L49 36 | 37 | *** 38 | 39 | 40 | 41 | ### UNKNOWN 42 | 43 | > **UNKNOWN**: `"unknown"` 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L50 46 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Enumeration.AxSpanKindValues.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxSpanKindValues 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L53 6 | 7 | ## Enumeration Members 8 | 9 | 10 | 11 | ### AGENT 12 | 13 | > **AGENT**: `"agent"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L56 16 | 17 | *** 18 | 19 | 20 | 21 | ### TASK 22 | 23 | > **TASK**: `"task"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L55 26 | 27 | *** 28 | 29 | 30 | 31 | ### TOOL 32 | 33 | > **TOOL**: `"tool"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L57 36 | 37 | *** 38 | 39 | 40 | 41 | ### UNKNOWN 42 | 43 | > **UNKNOWN**: `"unknown"` 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L58 46 | 47 | *** 48 | 49 | 50 | 51 | ### WORKFLOW 52 | 53 | > **WORKFLOW**: `"workflow"` 54 | 55 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/trace/trace.ts#L54 56 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIAnthropicContentBlockDeltaEvent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicContentBlockDeltaEvent 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L175 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### delta 12 | 13 | > **delta**: \{ `text`: `string`; `type`: `"text_delta"`; \} \| \{ `partial_json`: `string`; `type`: `"input_json_delta"`; \} 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L178 16 | 17 | *** 18 | 19 | 20 | 21 | ### index 22 | 23 | > **index**: `number` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L176 26 | 27 | *** 28 | 29 | 30 | 31 | ### type 32 | 33 | > **type**: `"content_block_delta"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L177 36 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIAnthropicContentBlockStartEvent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicContentBlockStartEvent 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L158 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### content\_block 12 | 13 | > **content\_block**: \{ `text`: `string`; `type`: `"text"`; \} \| \{ `id`: `string`; `input`: `object`; `name`: `string`; `type`: `"tool_use"`; \} 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L161 16 | 17 | *** 18 | 19 | 20 | 21 | ### index 22 | 23 | > **index**: `number` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L159 26 | 27 | *** 28 | 29 | 30 | 31 | ### type 32 | 33 | > **type**: `"content_block_start"` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L160 36 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIAnthropicContentBlockStopEvent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicContentBlockStopEvent 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L190 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### index 12 | 13 | > **index**: `number` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L192 16 | 17 | *** 18 | 19 | 20 | 21 | ### type 22 | 23 | > **type**: `"content_block_stop"` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L191 26 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIAnthropicErrorEvent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicErrorEvent 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L218 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### error 12 | 13 | > **error**: `object` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L220 16 | 17 | 18 | 19 | #### message 20 | 21 | > **message**: `string` 22 | 23 | 24 | 25 | #### type 26 | 27 | > **type**: `"overloaded_error"` 28 | 29 | *** 30 | 31 | 32 | 33 | ### type 34 | 35 | > **type**: `"error"` 36 | 37 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L219 38 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIAnthropicMessageDeltaEvent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicMessageDeltaEvent 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L196 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### delta 12 | 13 | > **delta**: `object` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L198 16 | 17 | 18 | 19 | #### stop\_reason 20 | 21 | > **stop\_reason**: `null` \| `"end_turn"` \| `"max_tokens"` \| `"stop_sequence"` 22 | 23 | 24 | 25 | #### stop\_sequence 26 | 27 | > **stop\_sequence**: `null` \| `string` 28 | 29 | *** 30 | 31 | 32 | 33 | ### type 34 | 35 | > **type**: `"message_delta"` 36 | 37 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L197 38 | 39 | *** 40 | 41 | 42 | 43 | ### usage 44 | 45 | > **usage**: `object` 46 | 47 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L202 48 | 49 | 50 | 51 | #### output\_tokens 52 | 53 | > **output\_tokens**: `number` 54 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIAnthropicMessageStartEvent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicMessageStartEvent 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L140 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### message 12 | 13 | > **message**: `object` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L142 16 | 17 | 18 | 19 | #### content 20 | 21 | > **content**: \[\] 22 | 23 | 24 | 25 | #### id 26 | 27 | > **id**: `string` 28 | 29 | 30 | 31 | #### model 32 | 33 | > **model**: `string` 34 | 35 | 36 | 37 | #### role 38 | 39 | > **role**: `"assistant"` 40 | 41 | 42 | 43 | #### stop\_reason 44 | 45 | > **stop\_reason**: `null` \| `string` 46 | 47 | 48 | 49 | #### stop\_sequence 50 | 51 | > **stop\_sequence**: `null` \| `string` 52 | 53 | 54 | 55 | #### type 56 | 57 | > **type**: `"message"` 58 | 59 | #### usage 60 | 61 | > \{ `input_tokens`: `number`; `output_tokens`: `number`; \} 62 | 63 | *** 64 | 65 | 66 | 67 | ### type 68 | 69 | > **type**: `"message_start"` 70 | 71 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L141 72 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIAnthropicMessageStopEvent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicMessageStopEvent 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L208 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### type 12 | 13 | > **type**: `"message_stop"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L209 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIAnthropicPingEvent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicPingEvent 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L213 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### type 12 | 13 | > **type**: `"ping"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L214 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAICohereArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereArgs 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/api.ts#L46 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### apiKey 12 | 13 | > **apiKey**: `string` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/api.ts#L48 16 | 17 | *** 18 | 19 | 20 | 21 | ### config? 22 | 23 | > `optional` **config**: `Readonly`\<`Partial`\<[`AxAICohereConfig`](/api/#03-apidocs/typealiasaxaicohereconfig)\>\> 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/api.ts#L49 26 | 27 | *** 28 | 29 | 30 | 31 | ### models? 32 | 33 | > `optional` **models**: `AxAIInputModelList`\<[`AxAICohereModel`](/api/#03-apidocs/enumerationaxaicoheremodel)\> 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/api.ts#L51 36 | 37 | *** 38 | 39 | 40 | 41 | ### name 42 | 43 | > **name**: `"cohere"` 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/api.ts#L47 46 | 47 | *** 48 | 49 | 50 | 51 | ### options? 52 | 53 | > `optional` **options**: `Readonly`\<[`AxAIServiceOptions`](/api/#03-apidocs/typealiasaxaiserviceoptions)\> 54 | 55 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/api.ts#L50 56 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIGoogleGeminiOptionsTools.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiOptionsTools 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/api.ts#L77 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### codeExecution? 12 | 13 | > `optional` **codeExecution**: `boolean` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/api.ts#L78 16 | 17 | *** 18 | 19 | 20 | 21 | ### googleSearch? 22 | 23 | > `optional` **googleSearch**: `boolean` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/api.ts#L83 26 | 27 | *** 28 | 29 | 30 | 31 | ### googleSearchRetrieval? 32 | 33 | > `optional` **googleSearchRetrieval**: `object` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/api.ts#L79 36 | 37 | 38 | 39 | #### dynamicThreshold? 40 | 41 | > `optional` **dynamicThreshold**: `number` 42 | 43 | 44 | 45 | #### mode? 46 | 47 | > `optional` **mode**: `"MODE_DYNAMIC"` 48 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIHuggingFaceArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIHuggingFaceArgs 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/api.ts#L37 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### apiKey 12 | 13 | > **apiKey**: `string` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/api.ts#L39 16 | 17 | *** 18 | 19 | 20 | 21 | ### config? 22 | 23 | > `optional` **config**: `Readonly`\<`Partial`\<[`AxAIHuggingFaceConfig`](/api/#03-apidocs/typealiasaxaihuggingfaceconfig)\>\> 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/api.ts#L40 26 | 27 | *** 28 | 29 | 30 | 31 | ### models? 32 | 33 | > `optional` **models**: `AxAIInputModelList`\<[`MetaLlama270BChatHF`](/api/#03-apidocs/enumerationaxaihuggingfacemodelmdmetallama270bchathf)\> 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/api.ts#L42 36 | 37 | *** 38 | 39 | 40 | 41 | ### name 42 | 43 | > **name**: `"huggingface"` 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/api.ts#L38 46 | 47 | *** 48 | 49 | 50 | 51 | ### options? 52 | 53 | > `optional` **options**: `Readonly`\<[`AxAIServiceOptions`](/api/#03-apidocs/typealiasaxaiserviceoptions)\> 54 | 55 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/api.ts#L41 56 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAIServiceMetrics.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIServiceMetrics 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L175 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### errors 12 | 13 | > **errors**: `object` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L190 16 | 17 | #### chat 18 | 19 | > \{ `count`: `number`; `rate`: `number`; `total`: `number`; \} 20 | 21 | #### embed 22 | 23 | > \{ `count`: `number`; `rate`: `number`; `total`: `number`; \} 24 | 25 | *** 26 | 27 | 28 | 29 | ### latency 30 | 31 | > **latency**: `object` 32 | 33 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L176 34 | 35 | #### chat 36 | 37 | > \{ `mean`: `number`; `p95`: `number`; `p99`: `number`; `samples`: `number`[]; \} 38 | 39 | #### embed 40 | 41 | > \{ `mean`: `number`; `p95`: `number`; `p99`: `number`; `samples`: `number`[]; \} 42 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxApacheTikaArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxApacheTikaArgs 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/tika.ts#L3 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### fetch()? 12 | 13 | > `optional` **fetch**: (`input`, `init`?) => `Promise`\<`Response`\> 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/tika.ts#L5 16 | 17 | #### Parameters 18 | 19 | | Parameter | Type | 20 | | ------ | ------ | 21 | | `input` | `string` \| `URL` \| `Request` | 22 | | `init`? | `RequestInit` | 23 | 24 | #### Returns 25 | 26 | `Promise`\<`Response`\> 27 | 28 | *** 29 | 30 | 31 | 32 | ### url? 33 | 34 | > `optional` **url**: `string` \| `URL` 35 | 36 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/tika.ts#L4 37 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxApacheTikaConvertOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxApacheTikaConvertOptions 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/tika.ts#L8 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### format? 12 | 13 | > `optional` **format**: `"text"` \| `"html"` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/tika.ts#L9 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxAssertion.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAssertion 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/asserts.ts#L3 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### message? 12 | 13 | > `optional` **message**: `string` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/asserts.ts#L5 16 | 17 | ## Methods 18 | 19 | 20 | 21 | ### fn() 22 | 23 | > **fn**(`values`): `undefined` \| `boolean` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/asserts.ts#L4 26 | 27 | #### Parameters 28 | 29 | | Parameter | Type | 30 | | ------ | ------ | 31 | | `values` | `Record`\<`string`, `unknown`\> | 32 | 33 | #### Returns 34 | 35 | `undefined` \| `boolean` 36 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxDBBaseArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBBaseArgs 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/base.ts#L13 6 | 7 | ## Extended by 8 | 9 | - [`AxDBCloudflareArgs`](/api/#03-apidocs/interfaceaxdbcloudflareargs) 10 | - [`AxDBMemoryArgs`](/api/#03-apidocs/interfaceaxdbmemoryargs) 11 | - [`AxDBPineconeArgs`](/api/#03-apidocs/interfaceaxdbpineconeargs) 12 | - [`AxDBWeaviateArgs`](/api/#03-apidocs/interfaceaxdbweaviateargs) 13 | 14 | ## Properties 15 | 16 | 17 | 18 | ### fetch()? 19 | 20 | > `optional` **fetch**: (`input`, `init`?) => `Promise`\<`Response`\> 21 | 22 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/base.ts#L14 23 | 24 | #### Parameters 25 | 26 | | Parameter | Type | 27 | | ------ | ------ | 28 | | `input` | `string` \| `URL` \| `Request` | 29 | | `init`? | `RequestInit` | 30 | 31 | #### Returns 32 | 33 | `Promise`\<`Response`\> 34 | 35 | *** 36 | 37 | 38 | 39 | ### tracer? 40 | 41 | > `optional` **tracer**: `Tracer` 42 | 43 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/base.ts#L15 44 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxDBBaseOpOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBBaseOpOptions 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/base.ts#L18 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### span? 12 | 13 | > `optional` **span**: `Span` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/base.ts#L19 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxDBLoaderOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBLoaderOptions 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L14 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### chunker()? 12 | 13 | > `optional` **chunker**: (`text`) => `string`[] 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L15 16 | 17 | #### Parameters 18 | 19 | | Parameter | Type | 20 | | ------ | ------ | 21 | | `text` | `string` | 22 | 23 | #### Returns 24 | 25 | `string`[] 26 | 27 | *** 28 | 29 | 30 | 31 | ### reranker? 32 | 33 | > `optional` **reranker**: [`AxProgram`](/api/#03-apidocs/classaxprogram)\<[`AxRerankerIn`](/api/#03-apidocs/typealiasaxrerankerin), [`AxRerankerOut`](/api/#03-apidocs/typealiasaxrerankerout)\> 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L17 36 | 37 | *** 38 | 39 | 40 | 41 | ### rewriter? 42 | 43 | > `optional` **rewriter**: [`AxProgram`](/api/#03-apidocs/classaxprogram)\<[`AxRewriteIn`](/api/#03-apidocs/typealiasaxrewritein), [`AxRewriteOut`](/api/#03-apidocs/typealiasaxrewriteout)\> 44 | 45 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L16 46 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxDBManagerArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBManagerArgs 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L20 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### ai 12 | 13 | > **ai**: [`AxAIService`](/api/#03-apidocs/interfaceaxaiservice) 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L21 16 | 17 | *** 18 | 19 | 20 | 21 | ### config? 22 | 23 | > `optional` **config**: [`AxDBLoaderOptions`](/api/#03-apidocs/interfaceaxdbloaderoptions) 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L23 26 | 27 | *** 28 | 29 | 30 | 31 | ### db 32 | 33 | > **db**: [`AxDBService`](/api/#03-apidocs/interfaceaxdbservice) 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L22 36 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxDBMatch.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBMatch 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L26 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### score 12 | 13 | > **score**: `number` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L27 16 | 17 | *** 18 | 19 | 20 | 21 | ### text 22 | 23 | > **text**: `string` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L28 26 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxDBMemoryArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBMemoryArgs 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/memory.ts#L11 6 | 7 | ## Extends 8 | 9 | - [`AxDBBaseArgs`](/api/#03-apidocs/interfaceaxdbbaseargs) 10 | 11 | ## Properties 12 | 13 | 14 | 15 | ### fetch()? 16 | 17 | > `optional` **fetch**: (`input`, `init`?) => `Promise`\<`Response`\> 18 | 19 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/base.ts#L14 20 | 21 | #### Parameters 22 | 23 | | Parameter | Type | 24 | | ------ | ------ | 25 | | `input` | `string` \| `URL` \| `Request` | 26 | | `init`? | `RequestInit` | 27 | 28 | #### Returns 29 | 30 | `Promise`\<`Response`\> 31 | 32 | #### Inherited from 33 | 34 | [`AxDBBaseArgs`](/api/#03-apidocs/interfaceaxdbbaseargs).[`fetch`](/api/#03-apidocs/interfaceaxdbbaseargsmdfetch) 35 | 36 | *** 37 | 38 | 39 | 40 | ### name 41 | 42 | > **name**: `"memory"` 43 | 44 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/memory.ts#L12 45 | 46 | *** 47 | 48 | 49 | 50 | ### tracer? 51 | 52 | > `optional` **tracer**: `Tracer` 53 | 54 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/base.ts#L15 55 | 56 | #### Inherited from 57 | 58 | [`AxDBBaseArgs`](/api/#03-apidocs/interfaceaxdbbaseargs).[`tracer`](/api/#03-apidocs/interfaceaxdbbaseargsmdtracer) 59 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxDBQueryService.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBQueryService 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/types.ts#L48 6 | 7 | ## Extended by 8 | 9 | - [`AxDBService`](/api/#03-apidocs/interfaceaxdbservice) 10 | 11 | ## Methods 12 | 13 | 14 | 15 | ### query() 16 | 17 | > **query**(`req`): `Promise`\<[`AxDBQueryResponse`](/api/#03-apidocs/typealiasaxdbqueryresponse)\> 18 | 19 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/types.ts#L49 20 | 21 | #### Parameters 22 | 23 | | Parameter | Type | 24 | | ------ | ------ | 25 | | `req` | `Readonly`\<[`AxDBQueryRequest`](/api/#03-apidocs/typealiasaxdbqueryrequest)\> | 26 | 27 | #### Returns 28 | 29 | `Promise`\<[`AxDBQueryResponse`](/api/#03-apidocs/typealiasaxdbqueryresponse)\> 30 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxProgramWithSignatureOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxProgramWithSignatureOptions 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L101 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### description? 12 | 13 | > `optional` **description**: `string` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L102 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxRateLimiterTokenUsageOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRateLimiterTokenUsageOptions 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/util/rate-limit.ts#L5 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### debug? 12 | 13 | > `optional` **debug**: `boolean` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/util/rate-limit.ts#L6 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxRouterForwardOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRouterForwardOptions 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/router.ts#L7 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### cutoff? 12 | 13 | > `optional` **cutoff**: `number` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/router.ts#L8 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxStreamingAssertion.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxStreamingAssertion 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/asserts.ts#L8 6 | 7 | ## Properties 8 | 9 | 10 | 11 | ### fieldName 12 | 13 | > **fieldName**: `string` 14 | 15 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/asserts.ts#L9 16 | 17 | *** 18 | 19 | 20 | 21 | ### message? 22 | 23 | > `optional` **message**: `string` 24 | 25 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/asserts.ts#L11 26 | 27 | ## Methods 28 | 29 | 30 | 31 | ### fn() 32 | 33 | > **fn**(`content`, `done`?): `undefined` \| `boolean` 34 | 35 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/asserts.ts#L10 36 | 37 | #### Parameters 38 | 39 | | Parameter | Type | 40 | | ------ | ------ | 41 | | `content` | `string` | 42 | | `done`? | `boolean` | 43 | 44 | #### Returns 45 | 46 | `undefined` \| `boolean` 47 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/Interface.AxUsable.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxUsable 3 | --- 4 | 5 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L91 6 | 7 | ## Extended by 8 | 9 | - [`AxAgentic`](/api/#03-apidocs/interfaceaxagentic) 10 | 11 | ## Properties 12 | 13 | 14 | 15 | ### getUsage() 16 | 17 | > **getUsage**: () => [`AxTokenUsage`](/api/#03-apidocs/typealiasaxtokenusage) & `object`[] 18 | 19 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L92 20 | 21 | #### Returns 22 | 23 | [`AxTokenUsage`](/api/#03-apidocs/typealiasaxtokenusage) & `object`[] 24 | 25 | *** 26 | 27 | 28 | 29 | ### resetUsage() 30 | 31 | > **resetUsage**: () => `void` 32 | 33 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L93 34 | 35 | #### Returns 36 | 37 | `void` 38 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIAnthropicChatError.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicChatError 3 | --- 4 | 5 | > **AxAIAnthropicChatError**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L131 8 | 9 | ## Type declaration 10 | 11 | ### error 12 | 13 | > \{ `message`: `string`; `type`: `"authentication_error"`; \} 14 | 15 | 16 | 17 | ### type 18 | 19 | > **type**: `"error"` 20 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIAnthropicChatRequestCacheParam.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicChatRequestCacheParam 3 | --- 4 | 5 | > **AxAIAnthropicChatRequestCacheParam**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L27 8 | 9 | ## Type declaration 10 | 11 | ### cache\_control? 12 | 13 | > \{ `type`: `"ephemeral"`; \} 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIAnthropicChatResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicChatResponse 3 | --- 4 | 5 | > **AxAIAnthropicChatResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L106 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### content 14 | 15 | > **content**: (\{ `text`: `string`; `type`: `"text"`; \} \| \{ `id`: `string`; `input`: `string`; `name`: `string`; `type`: `"tool_use"`; \})[] 16 | 17 | 18 | 19 | ### id 20 | 21 | > **id**: `string` 22 | 23 | 24 | 25 | ### model 26 | 27 | > **model**: `string` 28 | 29 | 30 | 31 | ### role 32 | 33 | > **role**: `"assistant"` 34 | 35 | 36 | 37 | ### stop\_reason 38 | 39 | > **stop\_reason**: `"end_turn"` \| `"max_tokens"` \| `"stop_sequence"` \| `"tool_use"` 40 | 41 | 42 | 43 | ### stop\_sequence? 44 | 45 | > `optional` **stop\_sequence**: `string` 46 | 47 | 48 | 49 | ### type 50 | 51 | > **type**: `"message"` 52 | 53 | ### usage 54 | 55 | > \{ `input_tokens`: `number`; `output_tokens`: `number`; \} 56 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIAnthropicChatResponseDelta.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicChatResponseDelta 3 | --- 4 | 5 | > **AxAIAnthropicChatResponseDelta**: [`AxAIAnthropicMessageStartEvent`](/api/#03-apidocs/interfaceaxaianthropicmessagestartevent) \| [`AxAIAnthropicContentBlockStartEvent`](/api/#03-apidocs/interfaceaxaianthropiccontentblockstartevent) \| [`AxAIAnthropicContentBlockDeltaEvent`](/api/#03-apidocs/interfaceaxaianthropiccontentblockdeltaevent) \| [`AxAIAnthropicContentBlockStopEvent`](/api/#03-apidocs/interfaceaxaianthropiccontentblockstopevent) \| [`AxAIAnthropicMessageDeltaEvent`](/api/#03-apidocs/interfaceaxaianthropicmessagedeltaevent) \| [`AxAIAnthropicMessageStopEvent`](/api/#03-apidocs/interfaceaxaianthropicmessagestopevent) \| [`AxAIAnthropicPingEvent`](/api/#03-apidocs/interfaceaxaianthropicpingevent) \| [`AxAIAnthropicErrorEvent`](/api/#03-apidocs/interfaceaxaianthropicerrorevent) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L227 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIAnthropicConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIAnthropicConfig 3 | --- 4 | 5 | > **AxAIAnthropicConfig**: [`AxModelConfig`](/api/#03-apidocs/typealiasaxmodelconfig) & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/anthropic/types.ts#L23 8 | 9 | ## Type declaration 10 | 11 | ### model 12 | 13 | > **model**: [`AxAIAnthropicModel`](/api/#03-apidocs/enumerationaxaianthropicmodel) \| [`AxAIAnthropicVertexModel`](/api/#03-apidocs/enumerationaxaianthropicvertexmodel) 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIArgs 3 | --- 4 | 5 | > **AxAIArgs**: [`AxAIOpenAIArgs`](/api/#03-apidocs/interfaceaxaiopenaiargs) \| [`AxAIAzureOpenAIArgs`](/api/#03-apidocs/typealiasaxaiazureopenaiargs) \| [`AxAITogetherArgs`](/api/#03-apidocs/typealiasaxaitogetherargs) \| [`AxAIAnthropicArgs`](/api/#03-apidocs/interfaceaxaianthropicargs) \| [`AxAIGroqArgs`](/api/#03-apidocs/typealiasaxaigroqargs) \| [`AxAIGoogleGeminiArgs`](/api/#03-apidocs/interfaceaxaigooglegeminiargs) \| [`AxAICohereArgs`](/api/#03-apidocs/interfaceaxaicohereargs) \| [`AxAIHuggingFaceArgs`](/api/#03-apidocs/interfaceaxaihuggingfaceargs) \| [`AxAIMistralArgs`](/api/#03-apidocs/typealiasaxaimistralargs) \| [`AxAIDeepSeekArgs`](/api/#03-apidocs/typealiasaxaideepseekargs) \| [`AxAIOllamaArgs`](/api/#03-apidocs/typealiasaxaiollamaargs) \| [`AxAIRekaArgs`](/api/#03-apidocs/interfaceaxairekaargs) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/wrap.ts#L48 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAICohereChatRequestToolResults.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereChatRequestToolResults 3 | --- 4 | 5 | > **AxAICohereChatRequestToolResults**: `object`[] 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L36 8 | 9 | ## Type declaration 10 | 11 | ### call 12 | 13 | > **call**: [`AxAICohereChatResponseToolCalls`](/api/#03-apidocs/typealiasaxaicoherechatresponsetoolcalls)\[`0`\] 14 | 15 | ### outputs 16 | 17 | > **outputs**: `object`[] 18 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAICohereChatResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereChatResponse 3 | --- 4 | 5 | > **AxAICohereChatResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L89 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### finish\_reason 14 | 15 | > **finish\_reason**: `"COMPLETE"` \| `"ERROR"` \| `"ERROR_TOXIC"` \| `"ERROR_LIMIT"` \| `"USER_CANCEL"` \| `"MAX_TOKENS"` 16 | 17 | 18 | 19 | ### generation\_id 20 | 21 | > **generation\_id**: `string` 22 | 23 | ### meta 24 | 25 | > \{ `billed_units`: \{ `input_tokens`: `number`; `output_tokens`: `number`; \}; \} 26 | 27 | 28 | 29 | ### response\_id 30 | 31 | > **response\_id**: `string` 32 | 33 | 34 | 35 | ### text 36 | 37 | > **text**: `string` 38 | 39 | 40 | 41 | ### tool\_calls 42 | 43 | > **tool\_calls**: [`AxAICohereChatResponseToolCalls`](/api/#03-apidocs/typealiasaxaicoherechatresponsetoolcalls) 44 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAICohereChatResponseDelta.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereChatResponseDelta 3 | --- 4 | 5 | > **AxAICohereChatResponseDelta**: [`AxAICohereChatResponse`](/api/#03-apidocs/typealiasaxaicoherechatresponse) & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L109 8 | 9 | ## Type declaration 10 | 11 | ### event\_type 12 | 13 | > **event\_type**: `"stream-start"` \| `"text-generation"` \| `"tool-calls-generation"` \| `"stream-end"` 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAICohereChatResponseToolCalls.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereChatResponseToolCalls 3 | --- 4 | 5 | > **AxAICohereChatResponseToolCalls**: `object`[] 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L31 8 | 9 | ## Type declaration 10 | 11 | ### name 12 | 13 | > **name**: `string` 14 | 15 | ### parameters? 16 | 17 | > `optional` **parameters**: `object` 18 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAICohereConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereConfig 3 | --- 4 | 5 | > **AxAICohereConfig**: [`AxModelConfig`](/api/#03-apidocs/typealiasaxmodelconfig) & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L26 8 | 9 | Cohere: Model options for text generation 10 | 11 | ## Type declaration 12 | 13 | ### embedModel? 14 | 15 | > `optional` **embedModel**: [`AxAICohereEmbedModel`](/api/#03-apidocs/enumerationaxaicohereembedmodel) 16 | 17 | ### model 18 | 19 | > **model**: [`AxAICohereModel`](/api/#03-apidocs/enumerationaxaicoheremodel) 20 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAICohereEmbedRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereEmbedRequest 3 | --- 4 | 5 | > **AxAICohereEmbedRequest**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L117 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### model 14 | 15 | > **model**: [`AxAICohereEmbedModel`](/api/#03-apidocs/enumerationaxaicohereembedmodel) 16 | 17 | 18 | 19 | ### texts 20 | 21 | > **texts**: readonly `string`[] 22 | 23 | 24 | 25 | ### truncate 26 | 27 | > **truncate**: `string` 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAICohereEmbedResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAICohereEmbedResponse 3 | --- 4 | 5 | > **AxAICohereEmbedResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/cohere/types.ts#L123 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### embeddings 14 | 15 | > **embeddings**: `number`[][] 16 | 17 | 18 | 19 | ### id 20 | 21 | > **id**: `string` 22 | 23 | 24 | 25 | ### model 26 | 27 | > **model**: [`AxAICohereEmbedModel`](/api/#03-apidocs/enumerationaxaicohereembedmodel) 28 | 29 | 30 | 31 | ### texts 32 | 33 | > **texts**: `string`[] 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIEmbedModels.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIEmbedModels 3 | --- 4 | 5 | > **AxAIEmbedModels**: [`AxAIOpenAIEmbedModel`](/api/#03-apidocs/enumerationaxaiopenaiembedmodel) \| [`AxAIGoogleGeminiEmbedModel`](/api/#03-apidocs/enumerationaxaigooglegeminiembedmodel) \| [`AxAICohereEmbedModel`](/api/#03-apidocs/enumerationaxaicohereembedmodel) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/wrap.ts#L72 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiBatchEmbedRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiBatchEmbedRequest 3 | --- 4 | 5 | > **AxAIGoogleGeminiBatchEmbedRequest**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L177 8 | 9 | AxAIGoogleGeminiEmbedRequest: Structure for making an embedding request to the Google Gemini API. 10 | 11 | ## Type declaration 12 | 13 | 14 | 15 | ### requests 16 | 17 | > **requests**: `object`[] 18 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiBatchEmbedResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiBatchEmbedResponse 3 | --- 4 | 5 | > **AxAIGoogleGeminiBatchEmbedResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L189 8 | 9 | AxAIGoogleGeminiEmbedResponse: Structure for handling responses from the Google Gemini API embedding requests. 10 | 11 | ## Type declaration 12 | 13 | 14 | 15 | ### embeddings 16 | 17 | > **embeddings**: `object`[] 18 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiChatRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiChatRequest 3 | --- 4 | 5 | > **AxAIGoogleGeminiChatRequest**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L121 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### contents 14 | 15 | > **contents**: [`AxAIGoogleGeminiContent`](/api/#03-apidocs/typealiasaxaigooglegeminicontent)[] 16 | 17 | 18 | 19 | ### generationConfig 20 | 21 | > **generationConfig**: [`AxAIGoogleGeminiGenerationConfig`](/api/#03-apidocs/typealiasaxaigooglegeminigenerationconfig) 22 | 23 | 24 | 25 | ### safetySettings? 26 | 27 | > `optional` **safetySettings**: [`AxAIGoogleGeminiSafetySettings`](/api/#03-apidocs/typealiasaxaigooglegeminisafetysettings) 28 | 29 | 30 | 31 | ### systemInstruction? 32 | 33 | > `optional` **systemInstruction**: [`AxAIGoogleGeminiContent`](/api/#03-apidocs/typealiasaxaigooglegeminicontent) 34 | 35 | 36 | 37 | ### toolConfig? 38 | 39 | > `optional` **toolConfig**: [`AxAIGoogleGeminiToolConfig`](/api/#03-apidocs/typealiasaxaigooglegeminitoolconfig) 40 | 41 | 42 | 43 | ### tools? 44 | 45 | > `optional` **tools**: [`AxAIGoogleGeminiTool`](/api/#03-apidocs/typealiasaxaigooglegeminitool)[] 46 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiChatResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiChatResponse 3 | --- 4 | 5 | > **AxAIGoogleGeminiChatResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L130 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### candidates 14 | 15 | > **candidates**: `object`[] 16 | 17 | ### usageMetadata 18 | 19 | > \{ `candidatesTokenCount`: `number`; `promptTokenCount`: `number`; `totalTokenCount`: `number`; \} 20 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiChatResponseDelta.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiChatResponseDelta 3 | --- 4 | 5 | > **AxAIGoogleGeminiChatResponseDelta**: [`AxAIGoogleGeminiChatResponse`](/api/#03-apidocs/typealiasaxaigooglegeminichatresponse) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L163 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiConfig 3 | --- 4 | 5 | > **AxAIGoogleGeminiConfig**: [`AxModelConfig`](/api/#03-apidocs/typealiasaxmodelconfig) & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L168 8 | 9 | AxAIGoogleGeminiConfig: Configuration options for Google Gemini API 10 | 11 | ## Type declaration 12 | 13 | ### embedModel? 14 | 15 | > `optional` **embedModel**: [`AxAIGoogleGeminiEmbedModel`](/api/#03-apidocs/enumerationaxaigooglegeminiembedmodel) 16 | 17 | ### model 18 | 19 | > **model**: [`AxAIGoogleGeminiModel`](/api/#03-apidocs/enumerationaxaigooglegeminimodel) 20 | 21 | ### safetySettings? 22 | 23 | > `optional` **safetySettings**: [`AxAIGoogleGeminiSafetySettings`](/api/#03-apidocs/typealiasaxaigooglegeminisafetysettings) 24 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiContent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiContent 3 | --- 4 | 5 | > **AxAIGoogleGeminiContent**: \{ `parts`: (\{ `text`: `string`; \} \| \{ `inlineData`: \{ `data`: `string`; `mimeType`: `string`; \}; \} \| \{ `fileData`: \{ `fileUri`: `string`; `mimeType`: `string`; \}; \})[]; `role`: `"user"`; \} \| \{ `parts`: `object`[] \| `object`[]; `role`: `"model"`; \} \| \{ `parts`: `object`[]; `role`: `"function"`; \} 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L37 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiGenerationConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiGenerationConfig 3 | --- 4 | 5 | > **AxAIGoogleGeminiGenerationConfig**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L107 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### candidateCount? 14 | 15 | > `optional` **candidateCount**: `number` 16 | 17 | 18 | 19 | ### maxOutputTokens? 20 | 21 | > `optional` **maxOutputTokens**: `number` 22 | 23 | 24 | 25 | ### stopSequences? 26 | 27 | > `optional` **stopSequences**: readonly `string`[] 28 | 29 | 30 | 31 | ### temperature? 32 | 33 | > `optional` **temperature**: `number` 34 | 35 | 36 | 37 | ### topK? 38 | 39 | > `optional` **topK**: `number` 40 | 41 | 42 | 43 | ### topP? 44 | 45 | > `optional` **topP**: `number` 46 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiSafetySettings.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiSafetySettings 3 | --- 4 | 5 | > **AxAIGoogleGeminiSafetySettings**: `object`[] 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L116 8 | 9 | ## Type declaration 10 | 11 | ### category 12 | 13 | > **category**: [`AxAIGoogleGeminiSafetyCategory`](/api/#03-apidocs/enumerationaxaigooglegeminisafetycategory) 14 | 15 | ### threshold 16 | 17 | > **threshold**: [`AxAIGoogleGeminiSafetyThreshold`](/api/#03-apidocs/enumerationaxaigooglegeminisafetythreshold) 18 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiTool.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiTool 3 | --- 4 | 5 | > **AxAIGoogleGeminiTool**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L94 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### code\_execution? 14 | 15 | > `optional` **code\_execution**: `object` 16 | 17 | 18 | 19 | ### function\_declarations? 20 | 21 | > `optional` **function\_declarations**: [`AxAIGoogleGeminiToolFunctionDeclaration`](/api/#03-apidocs/typealiasaxaigooglegeminitoolfunctiondeclaration)[] 22 | 23 | 24 | 25 | ### google\_search\_retrieval? 26 | 27 | > `optional` **google\_search\_retrieval**: [`AxAIGoogleGeminiToolGoogleSearchRetrieval`](/api/#03-apidocs/typealiasaxaigooglegeminitoolgooglesearchretrieval) 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiToolConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiToolConfig 3 | --- 4 | 5 | > **AxAIGoogleGeminiToolConfig**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L100 8 | 9 | ## Type declaration 10 | 11 | ### function\_calling\_config 12 | 13 | > \{ `allowed_function_names`: `string`[]; `mode`: `"ANY"` \| `"NONE"` \| `"AUTO"`; \} 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiToolFunctionDeclaration.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiToolFunctionDeclaration 3 | --- 4 | 5 | > **AxAIGoogleGeminiToolFunctionDeclaration**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L81 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### description? 14 | 15 | > `optional` **description**: `string` 16 | 17 | 18 | 19 | ### name 20 | 21 | > **name**: `string` 22 | 23 | 24 | 25 | ### parameters? 26 | 27 | > `optional` **parameters**: `object` 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIGoogleGeminiToolGoogleSearchRetrieval.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIGoogleGeminiToolGoogleSearchRetrieval 3 | --- 4 | 5 | > **AxAIGoogleGeminiToolGoogleSearchRetrieval**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/google-gemini/types.ts#L87 8 | 9 | ## Type declaration 10 | 11 | ### dynamic\_retrieval\_config 12 | 13 | > \{ `dynamic_threshold`: `number`; `mode`: `"MODE_DYNAMIC"`; \} 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIHuggingFaceConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIHuggingFaceConfig 3 | --- 4 | 5 | > **AxAIHuggingFaceConfig**: [`AxModelConfig`](/api/#03-apidocs/typealiasaxmodelconfig) & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/types.ts#L7 8 | 9 | ## Type declaration 10 | 11 | ### doSample? 12 | 13 | > `optional` **doSample**: `boolean` 14 | 15 | ### maxTime? 16 | 17 | > `optional` **maxTime**: `number` 18 | 19 | ### model 20 | 21 | > **model**: [`AxAIHuggingFaceModel`](/api/#03-apidocs/enumerationaxaihuggingfacemodel) 22 | 23 | ### returnFullText? 24 | 25 | > `optional` **returnFullText**: `boolean` 26 | 27 | ### useCache? 28 | 29 | > `optional` **useCache**: `boolean` 30 | 31 | ### waitForModel? 32 | 33 | > `optional` **waitForModel**: `boolean` 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIHuggingFaceRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIHuggingFaceRequest 3 | --- 4 | 5 | > **AxAIHuggingFaceRequest**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/types.ts#L16 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### inputs 14 | 15 | > **inputs**: `string` 16 | 17 | 18 | 19 | ### model 20 | 21 | > **model**: [`AxAIHuggingFaceModel`](/api/#03-apidocs/enumerationaxaihuggingfacemodel) 22 | 23 | ### options? 24 | 25 | > \{ `use_cache`: `boolean`; `wait_for_model`: `boolean`; \} 26 | 27 | ### parameters 28 | 29 | > \{ `do_sample`: `boolean`; `max_new_tokens`: `number`; `max_time`: `number`; `num_return_sequences`: `number`; `repetition_penalty`: `number`; `return_full_text`: `boolean`; `temperature`: `number`; `top_k`: `number`; `top_p`: `number`; \} 30 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIHuggingFaceResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIHuggingFaceResponse 3 | --- 4 | 5 | > **AxAIHuggingFaceResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/huggingface/types.ts#L36 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### generated\_text 14 | 15 | > **generated\_text**: `string` 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIModels.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIModels 3 | --- 4 | 5 | > **AxAIModels**: [`AxAIOpenAIModel`](/api/#03-apidocs/enumerationaxaiopenaimodel) \| [`AxAIAnthropicModel`](/api/#03-apidocs/enumerationaxaianthropicmodel) \| [`AxAIGroqModel`](/api/#03-apidocs/enumerationaxaigroqmodel) \| [`AxAIGoogleGeminiModel`](/api/#03-apidocs/enumerationaxaigooglegeminimodel) \| [`AxAICohereModel`](/api/#03-apidocs/enumerationaxaicoheremodel) \| [`AxAIHuggingFaceModel`](/api/#03-apidocs/enumerationaxaihuggingfacemodel) \| [`AxAIMistralModel`](/api/#03-apidocs/enumerationaxaimistralmodel) \| [`AxAIDeepSeekModel`](/api/#03-apidocs/enumerationaxaideepseekmodel) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/wrap.ts#L62 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOllamaAIConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOllamaAIConfig 3 | --- 4 | 5 | > **AxAIOllamaAIConfig**: [`AxAIOpenAIConfig`](/api/#03-apidocs/typealiasaxaiopenaiconfig)\<`string`, `string`\> 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/ollama/api.ts#L8 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOllamaArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOllamaArgs 3 | --- 4 | 5 | > **AxAIOllamaArgs**: [`AxAIOpenAIArgs`](/api/#03-apidocs/interfaceaxaiopenaiargs)\<`"ollama"`, `string`, `string`\> & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/ollama/api.ts#L24 8 | 9 | ## Type declaration 10 | 11 | ### embedModel? 12 | 13 | > `optional` **embedModel**: `string` 14 | 15 | ### model? 16 | 17 | > `optional` **model**: `string` 18 | 19 | ### url? 20 | 21 | > `optional` **url**: `string` 22 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOpenAIChatResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOpenAIChatResponse 3 | --- 4 | 5 | > **AxAIOpenAIChatResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L139 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### choices 14 | 15 | > **choices**: `object`[] 16 | 17 | 18 | 19 | ### created 20 | 21 | > **created**: `number` 22 | 23 | ### error? 24 | 25 | > \{ `code`: `number`; `message`: `string`; `param`: `string`; `type`: `string`; \} 26 | 27 | 28 | 29 | ### id 30 | 31 | > **id**: `string` 32 | 33 | 34 | 35 | ### model 36 | 37 | > **model**: `string` 38 | 39 | 40 | 41 | ### object 42 | 43 | > **object**: `"chat.completion"` 44 | 45 | 46 | 47 | ### system\_fingerprint 48 | 49 | > **system\_fingerprint**: `string` 50 | 51 | 52 | 53 | ### usage? 54 | 55 | > `optional` **usage**: [`AxAIOpenAIUsage`](/api/#03-apidocs/typealiasaxaiopenaiusage) 56 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOpenAIChatResponseDelta.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOpenAIChatResponseDelta 3 | --- 4 | 5 | > **AxAIOpenAIChatResponseDelta**: [`AxAIOpenAIResponseDelta`](/api/#03-apidocs/interfaceaxaiopenairesponsedelta)\<\{ `content`: `string`; `role`: `string`; `tool_calls`: `NonNullable`\<...\[...\]\[`0`\]\[`"message"`\]\[`"tool_calls"`\]\>\[`0`\] & `object`[]; \}\> 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L168 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOpenAIConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOpenAIConfig 3 | --- 4 | 5 | > **AxAIOpenAIConfig**\<`TModel`, `TEmbedModel`\>: `Omit`\<[`AxModelConfig`](/api/#03-apidocs/typealiasaxmodelconfig), `"topK"`\> & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L25 8 | 9 | ## Type declaration 10 | 11 | ### bestOf? 12 | 13 | > `optional` **bestOf**: `number` 14 | 15 | ### dimensions? 16 | 17 | > `optional` **dimensions**: `number` 18 | 19 | ### echo? 20 | 21 | > `optional` **echo**: `boolean` 22 | 23 | ### embedModel? 24 | 25 | > `optional` **embedModel**: `TEmbedModel` 26 | 27 | ### logitBias? 28 | 29 | > `optional` **logitBias**: `Map`\<`string`, `number`\> 30 | 31 | ### logprobs? 32 | 33 | > `optional` **logprobs**: `number` 34 | 35 | ### model 36 | 37 | > **model**: `TModel` 38 | 39 | ### reasoningEffort? 40 | 41 | > `optional` **reasoningEffort**: `"low"` \| `"medium"` \| `"high"` 42 | 43 | ### responseFormat? 44 | 45 | > `optional` **responseFormat**: `"json_object"` 46 | 47 | ### stop? 48 | 49 | > `optional` **stop**: `string`[] 50 | 51 | ### store? 52 | 53 | > `optional` **store**: `boolean` 54 | 55 | ### suffix? 56 | 57 | > `optional` **suffix**: `string` \| `null` 58 | 59 | ### user? 60 | 61 | > `optional` **user**: `string` 62 | 63 | ## Type Parameters 64 | 65 | | Type Parameter | 66 | | ------ | 67 | | `TModel` | 68 | | `TEmbedModel` | 69 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOpenAIEmbedRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOpenAIEmbedRequest 3 | --- 4 | 5 | > **AxAIOpenAIEmbedRequest**\<`TEmbedModel`\>: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L178 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | 12 | | ------ | 13 | | `TEmbedModel` | 14 | 15 | ## Type declaration 16 | 17 | 18 | 19 | ### dimensions? 20 | 21 | > `optional` **dimensions**: `number` 22 | 23 | 24 | 25 | ### input 26 | 27 | > **input**: readonly `string`[] 28 | 29 | 30 | 31 | ### model 32 | 33 | > **model**: `TEmbedModel` 34 | 35 | 36 | 37 | ### user? 38 | 39 | > `optional` **user**: `string` 40 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOpenAIEmbedResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOpenAIEmbedResponse 3 | --- 4 | 5 | > **AxAIOpenAIEmbedResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L185 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### data 14 | 15 | > **data**: `object`[] 16 | 17 | 18 | 19 | ### model 20 | 21 | > **model**: `string` 22 | 23 | 24 | 25 | ### usage 26 | 27 | > **usage**: [`AxAIOpenAIUsage`](/api/#03-apidocs/typealiasaxaiopenaiusage) 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOpenAILogprob.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOpenAILogprob 3 | --- 4 | 5 | > **AxAIOpenAILogprob**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L44 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### text\_offset 14 | 15 | > **text\_offset**: `number`[] 16 | 17 | 18 | 19 | ### token\_logprobs 20 | 21 | > **token\_logprobs**: `number`[] 22 | 23 | 24 | 25 | ### tokens 26 | 27 | > **tokens**: `string`[] 28 | 29 | 30 | 31 | ### top\_logprobs 32 | 33 | > **top\_logprobs**: `Map`\<`string`, `number`\> 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIOpenAIUsage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIOpenAIUsage 3 | --- 4 | 5 | > **AxAIOpenAIUsage**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/openai/types.ts#L51 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### completion\_tokens 14 | 15 | > **completion\_tokens**: `number` 16 | 17 | 18 | 19 | ### prompt\_tokens 20 | 21 | > **prompt\_tokens**: `number` 22 | 23 | 24 | 25 | ### total\_tokens 26 | 27 | > **total\_tokens**: `number` 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIPromptConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIPromptConfig 3 | --- 4 | 5 | > **AxAIPromptConfig**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L223 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### stream? 14 | 15 | > `optional` **stream**: `boolean` 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIRekaChatRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIRekaChatRequest 3 | --- 4 | 5 | > **AxAIRekaChatRequest**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L20 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### frequency\_penalty? 14 | 15 | > `optional` **frequency\_penalty**: `number` 16 | 17 | 18 | 19 | ### max\_tokens 20 | 21 | > **max\_tokens**: `number` 22 | 23 | 24 | 25 | ### messages 26 | 27 | > **messages**: (\{ `content`: `string` \| `object`[]; `role`: `"user"`; \} \| \{ `content`: `string` \| `object`[]; `role`: `"assistant"`; \})[] 28 | 29 | 30 | 31 | ### model 32 | 33 | > **model**: `string` 34 | 35 | 36 | 37 | ### presence\_penalty? 38 | 39 | > `optional` **presence\_penalty**: `number` 40 | 41 | ### response\_format? 42 | 43 | > \{ `type`: `string`; \} 44 | 45 | 46 | 47 | ### stop? 48 | 49 | > `optional` **stop**: readonly `string`[] 50 | 51 | 52 | 53 | ### stream? 54 | 55 | > `optional` **stream**: `boolean` 56 | 57 | 58 | 59 | ### temperature? 60 | 61 | > `optional` **temperature**: `number` 62 | 63 | 64 | 65 | ### top\_k? 66 | 67 | > `optional` **top\_k**: `number` 68 | 69 | 70 | 71 | ### top\_p? 72 | 73 | > `optional` **top\_p**: `number` 74 | 75 | 76 | 77 | ### usage? 78 | 79 | > `optional` **usage**: [`AxAIRekaUsage`](/api/#03-apidocs/typealiasaxairekausage) 80 | 81 | 82 | 83 | ### use\_search\_engine? 84 | 85 | > `optional` **use\_search\_engine**: `boolean` 86 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIRekaChatResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIRekaChatResponse 3 | --- 4 | 5 | > **AxAIRekaChatResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L55 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### id 14 | 15 | > **id**: `string` 16 | 17 | 18 | 19 | ### model 20 | 21 | > **model**: `string` 22 | 23 | 24 | 25 | ### responses 26 | 27 | > **responses**: `object`[] 28 | 29 | 30 | 31 | ### usage? 32 | 33 | > `optional` **usage**: [`AxAIRekaUsage`](/api/#03-apidocs/typealiasaxairekausage) 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIRekaChatResponseDelta.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIRekaChatResponseDelta 3 | --- 4 | 5 | > **AxAIRekaChatResponseDelta**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L72 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### id 14 | 15 | > **id**: `string` 16 | 17 | 18 | 19 | ### model 20 | 21 | > **model**: `string` 22 | 23 | 24 | 25 | ### responses 26 | 27 | > **responses**: `object`[] 28 | 29 | 30 | 31 | ### usage? 32 | 33 | > `optional` **usage**: [`AxAIRekaUsage`](/api/#03-apidocs/typealiasaxairekausage) 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIRekaConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIRekaConfig 3 | --- 4 | 5 | > **AxAIRekaConfig**: `Omit`\<[`AxModelConfig`](/api/#03-apidocs/typealiasaxmodelconfig), `"topK"`\> & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L9 8 | 9 | ## Type declaration 10 | 11 | ### model 12 | 13 | > **model**: [`AxAIRekaModel`](/api/#03-apidocs/enumerationaxairekamodel) 14 | 15 | ### stop? 16 | 17 | > `optional` **stop**: readonly `string`[] 18 | 19 | ### useSearchEngine? 20 | 21 | > `optional` **useSearchEngine**: `boolean` 22 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIRekaUsage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIRekaUsage 3 | --- 4 | 5 | > **AxAIRekaUsage**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/reka/types.ts#L15 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### input\_tokens 14 | 15 | > **input\_tokens**: `number` 16 | 17 | 18 | 19 | ### output\_tokens 20 | 21 | > **output\_tokens**: `number` 22 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIServiceActionOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIServiceActionOptions 3 | --- 4 | 5 | > **AxAIServiceActionOptions**\<`TModel`, `TEmbedModel`\>: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L234 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | Default type | 12 | | ------ | ------ | 13 | | `TModel` | `unknown` | 14 | | `TEmbedModel` | `unknown` | 15 | 16 | ## Type declaration 17 | 18 | 19 | 20 | ### ai? 21 | 22 | > `optional` **ai**: `Readonly`\<[`AxAIService`](/api/#03-apidocs/interfaceaxaiservice)\<`TModel`, `TEmbedModel`\>\> 23 | 24 | 25 | 26 | ### debug? 27 | 28 | > `optional` **debug**: `boolean` 29 | 30 | 31 | 32 | ### rateLimiter? 33 | 34 | > `optional` **rateLimiter**: [`AxRateLimiterFunction`](/api/#03-apidocs/typealiasaxratelimiterfunction) 35 | 36 | 37 | 38 | ### sessionId? 39 | 40 | > `optional` **sessionId**: `string` 41 | 42 | 43 | 44 | ### traceId? 45 | 46 | > `optional` **traceId**: `string` 47 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAIServiceOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAIServiceOptions 3 | --- 4 | 5 | > **AxAIServiceOptions**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L227 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### debug? 14 | 15 | > `optional` **debug**: `boolean` 16 | 17 | 18 | 19 | ### fetch? 20 | 21 | > `optional` **fetch**: *typeof* [`__type`](/api/#03-apidocs/interfaceaxapiconfig) 22 | 23 | 24 | 25 | ### rateLimiter? 26 | 27 | > `optional` **rateLimiter**: [`AxRateLimiterFunction`](/api/#03-apidocs/typealiasaxratelimiterfunction) 28 | 29 | 30 | 31 | ### tracer? 32 | 33 | > `optional` **tracer**: `Tracer` 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxAgentOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxAgentOptions 3 | --- 4 | 5 | > **AxAgentOptions**: `Omit`\<[`AxGenOptions`](/api/#03-apidocs/interfaceaxgenoptions), `"functions"`\> & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/prompts/agent.ts#L32 8 | 9 | ## Type declaration 10 | 11 | ### debug? 12 | 13 | > `optional` **debug**: `boolean` 14 | 15 | ### disableSmartModelRouting? 16 | 17 | > `optional` **disableSmartModelRouting**: `boolean` 18 | 19 | ### excludeFieldsFromPassthrough? 20 | 21 | > `optional` **excludeFieldsFromPassthrough**: `string`[] 22 | 23 | List of field names that should not be automatically passed from parent to child agents 24 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxBalancerOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxBalancerOptions 3 | --- 4 | 5 | > **AxBalancerOptions**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/balance.ts#L29 8 | 9 | Options for the balancer. 10 | 11 | ## Type declaration 12 | 13 | ### comparator()? 14 | 15 | > (`a`, `b`) => `number` 16 | 17 | 18 | 19 | ### debug? 20 | 21 | > `optional` **debug**: `boolean` 22 | 23 | 24 | 25 | ### initialBackoffMs? 26 | 27 | > `optional` **initialBackoffMs**: `number` 28 | 29 | 30 | 31 | ### maxBackoffMs? 32 | 33 | > `optional` **maxBackoffMs**: `number` 34 | 35 | 36 | 37 | ### maxRetries? 38 | 39 | > `optional` **maxRetries**: `number` 40 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxChatResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxChatResponse 3 | --- 4 | 5 | > **AxChatResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L96 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### embedModelUsage? 14 | 15 | > `optional` **embedModelUsage**: [`AxTokenUsage`](/api/#03-apidocs/typealiasaxtokenusage) 16 | 17 | 18 | 19 | ### modelUsage? 20 | 21 | > `optional` **modelUsage**: [`AxTokenUsage`](/api/#03-apidocs/typealiasaxtokenusage) 22 | 23 | 24 | 25 | ### remoteId? 26 | 27 | > `optional` **remoteId**: `string` 28 | 29 | 30 | 31 | ### results 32 | 33 | > **results**: readonly [`AxChatResponseResult`](/api/#03-apidocs/typealiasaxchatresponseresult)[] 34 | 35 | 36 | 37 | ### sessionId? 38 | 39 | > `optional` **sessionId**: `string` 40 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxChatResponseFunctionCall.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxChatResponseFunctionCall 3 | --- 4 | 5 | > **AxChatResponseFunctionCall**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/functions.ts#L67 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### args 14 | 15 | > **args**: `string` 16 | 17 | 18 | 19 | ### id 20 | 21 | > **id**: `string` 22 | 23 | 24 | 25 | ### name 26 | 27 | > **name**: `string` 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxChatResponseResult.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxChatResponseResult 3 | --- 4 | 5 | > **AxChatResponseResult**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L79 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### content? 14 | 15 | > `optional` **content**: `string` 16 | 17 | 18 | 19 | ### finishReason? 20 | 21 | > `optional` **finishReason**: `"stop"` \| `"length"` \| `"function_call"` \| `"content_filter"` \| `"error"` 22 | 23 | 24 | 25 | ### functionCalls? 26 | 27 | > `optional` **functionCalls**: `object`[] 28 | 29 | 30 | 31 | ### id? 32 | 33 | > `optional` **id**: `string` 34 | 35 | 36 | 37 | ### name? 38 | 39 | > `optional` **name**: `string` 40 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBArgs 3 | --- 4 | 5 | > **AxDBArgs**: [`AxDBCloudflareArgs`](/api/#03-apidocs/interfaceaxdbcloudflareargs) \| [`AxDBPineconeArgs`](/api/#03-apidocs/interfaceaxdbpineconeargs) \| [`AxDBWeaviateArgs`](/api/#03-apidocs/interfaceaxdbweaviateargs) \| [`AxDBMemoryArgs`](/api/#03-apidocs/interfaceaxdbmemoryargs) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/wrap.ts#L13 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBCloudflareOpOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBCloudflareOpOptions 3 | --- 4 | 5 | > **AxDBCloudflareOpOptions**: [`AxDBBaseOpOptions`](/api/#03-apidocs/interfaceaxdbbaseopoptions) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/cloudflare.ts#L13 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBMemoryOpOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBMemoryOpOptions 3 | --- 4 | 5 | > **AxDBMemoryOpOptions**: [`AxDBBaseOpOptions`](/api/#03-apidocs/interfaceaxdbbaseopoptions) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/memory.ts#L9 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBPineconeOpOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBPineconeOpOptions 3 | --- 4 | 5 | > **AxDBPineconeOpOptions**: [`AxDBBaseOpOptions`](/api/#03-apidocs/interfaceaxdbbaseopoptions) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/pinecone.ts#L11 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBQueryRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBQueryRequest 3 | --- 4 | 5 | > **AxDBQueryRequest**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/types.ts#L17 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### columns? 14 | 15 | > `optional` **columns**: `string`[] 16 | 17 | 18 | 19 | ### id? 20 | 21 | > `optional` **id**: `string` 22 | 23 | 24 | 25 | ### limit? 26 | 27 | > `optional` **limit**: `number` 28 | 29 | 30 | 31 | ### namespace? 32 | 33 | > `optional` **namespace**: `string` 34 | 35 | 36 | 37 | ### table 38 | 39 | > **table**: `string` 40 | 41 | 42 | 43 | ### text? 44 | 45 | > `optional` **text**: `string` 46 | 47 | 48 | 49 | ### values? 50 | 51 | > `optional` **values**: readonly `number`[] 52 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBQueryResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBQueryResponse 3 | --- 4 | 5 | > **AxDBQueryResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/types.ts#L27 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### matches 14 | 15 | > **matches**: `object`[] 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBState.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBState 3 | --- 4 | 5 | > **AxDBState**: `Record`\<`string`, `Record`\<`string`, [`AxDBUpsertRequest`](/api/#03-apidocs/typealiasaxdbupsertrequest)\>\> 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/memory.ts#L15 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBUpsertRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBUpsertRequest 3 | --- 4 | 5 | > **AxDBUpsertRequest**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/types.ts#L3 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### id 14 | 15 | > **id**: `string` 16 | 17 | 18 | 19 | ### metadata? 20 | 21 | > `optional` **metadata**: `Record`\<`string`, `string`\> 22 | 23 | 24 | 25 | ### namespace? 26 | 27 | > `optional` **namespace**: `string` 28 | 29 | 30 | 31 | ### table 32 | 33 | > **table**: `string` 34 | 35 | 36 | 37 | ### text? 38 | 39 | > `optional` **text**: `string` 40 | 41 | 42 | 43 | ### values? 44 | 45 | > `optional` **values**: readonly `number`[] 46 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBUpsertResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBUpsertResponse 3 | --- 4 | 5 | > **AxDBUpsertResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/types.ts#L12 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### ids 14 | 15 | > **ids**: `string`[] 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDBWeaviateOpOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDBWeaviateOpOptions 3 | --- 4 | 5 | > **AxDBWeaviateOpOptions**: [`AxDBBaseOpOptions`](/api/#03-apidocs/interfaceaxdbbaseopoptions) 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/db/weaviate.ts#L11 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxDataRow.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxDataRow 3 | --- 4 | 5 | > **AxDataRow**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/loader.ts#L3 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### row 14 | 15 | > **row**: `Record`\<`string`, [`AxFieldValue`](/api/#03-apidocs/typealiasaxfieldvalue)\> 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxEmbedRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxEmbedRequest 3 | --- 4 | 5 | > **AxEmbedRequest**\<`TEmbedModel`\>: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L207 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | Default type | 12 | | ------ | ------ | 13 | | `TEmbedModel` | `string` | 14 | 15 | ## Type declaration 16 | 17 | 18 | 19 | ### embedModel? 20 | 21 | > `optional` **embedModel**: `TEmbedModel` 22 | 23 | 24 | 25 | ### texts? 26 | 27 | > `optional` **texts**: readonly `string`[] 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxEmbedResponse.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxEmbedResponse 3 | --- 4 | 5 | > **AxEmbedResponse**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L104 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### embeddings 14 | 15 | > **embeddings**: readonly readonly `number`[][] 16 | 17 | 18 | 19 | ### modelUsage? 20 | 21 | > `optional` **modelUsage**: [`AxTokenUsage`](/api/#03-apidocs/typealiasaxtokenusage) 22 | 23 | 24 | 25 | ### remoteId? 26 | 27 | > `optional` **remoteId**: `string` 28 | 29 | 30 | 31 | ### sessionId? 32 | 33 | > `optional` **sessionId**: `string` 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxEvaluateArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxEvaluateArgs 3 | --- 4 | 5 | > **AxEvaluateArgs**\<`IN`, `OUT`\>: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/evaluate.ts#L7 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | 12 | | ------ | 13 | | `IN` *extends* [`AxGenIn`](/api/#03-apidocs/typealiasaxgenin) | 14 | | `OUT` *extends* [`AxGenOut`](/api/#03-apidocs/typealiasaxgenout) | 15 | 16 | ## Type declaration 17 | 18 | 19 | 20 | ### ai 21 | 22 | > **ai**: [`AxAIService`](/api/#03-apidocs/interfaceaxaiservice) 23 | 24 | 25 | 26 | ### examples 27 | 28 | > **examples**: `Readonly`\<[`AxExample`](/api/#03-apidocs/typealiasaxexample)[]\> 29 | 30 | 31 | 32 | ### program 33 | 34 | > **program**: `Readonly`\<[`AxProgram`](/api/#03-apidocs/classaxprogram)\<`IN`, `OUT`\>\> 35 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxExample.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxExample 3 | --- 4 | 5 | > **AxExample**: `Record`\<`string`, [`AxFieldValue`](/api/#03-apidocs/typealiasaxfieldvalue)\> 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/optimize.ts#L13 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxFieldTemplateFn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxFieldTemplateFn 3 | --- 4 | 5 | > **AxFieldTemplateFn**: (`field`, `value`) => `any`[] 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/prompt.ts#L30 8 | 9 | ## Parameters 10 | 11 | | Parameter | Type | 12 | | ------ | ------ | 13 | | `field` | `Readonly`\<[`AxField`](/api/#03-apidocs/interfaceaxfield)\> | 14 | | `value` | `Readonly`\<[`AxFieldValue`](/api/#03-apidocs/typealiasaxfieldvalue)\> | 15 | 16 | ## Returns 17 | 18 | `any`[] 19 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxFieldValue.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxFieldValue 3 | --- 4 | 5 | > **AxFieldValue**: `string` \| `string`[] \| `number` \| `boolean` \| `object` \| `null` \| `undefined` \| \{ `data`: `string`; `mimeType`: `string`; \} \| `object`[] \| \{ `data`: `string`; `format`: `"wav"`; \} \| `object`[] 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L17 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxFunction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxFunction 3 | --- 4 | 5 | > **AxFunction**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L72 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### description 14 | 15 | > **description**: `string` 16 | 17 | 18 | 19 | ### func 20 | 21 | > **func**: [`AxFunctionHandler`](/api/#03-apidocs/typealiasaxfunctionhandler) 22 | 23 | 24 | 25 | ### name 26 | 27 | > **name**: `string` 28 | 29 | 30 | 31 | ### parameters? 32 | 33 | > `optional` **parameters**: [`AxFunctionJSONSchema`](/api/#03-apidocs/typealiasaxfunctionjsonschema) 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxFunctionHandler.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxFunctionHandler 3 | --- 4 | 5 | > **AxFunctionHandler**: (`args`?, `extra`?) => `unknown` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L48 8 | 9 | ## Parameters 10 | 11 | | Parameter | Type | 12 | | ------ | ------ | 13 | | `args`? | `any` | 14 | | `extra`? | `Readonly`\<\{ `ai`: [`AxAIService`](/api/#03-apidocs/interfaceaxaiservice); `debug`: `boolean`; `sessionId`: `string`; `traceId`: `string`; \}\> | 15 | 16 | ## Returns 17 | 18 | `unknown` 19 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxFunctionJSONSchema.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxFunctionJSONSchema 3 | --- 4 | 5 | > **AxFunctionJSONSchema**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L59 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### items? 14 | 15 | > `optional` **items**: [`AxFunctionJSONSchema`](/api/#03-apidocs/typealiasaxfunctionjsonschema) 16 | 17 | 18 | 19 | ### properties? 20 | 21 | > `optional` **properties**: `Record`\<`string`, [`AxFunctionJSONSchema`](/api/#03-apidocs/typealiasaxfunctionjsonschema) & `object`\> 22 | 23 | 24 | 25 | ### required? 26 | 27 | > `optional` **required**: `string`[] 28 | 29 | 30 | 31 | ### type 32 | 33 | > **type**: `string` 34 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxGenIn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxGenIn 3 | --- 4 | 5 | > **AxGenIn**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L30 8 | 9 | ## Index Signature 10 | 11 | \[`key`: `symbol`\]: [`AxFieldValue`](/api/#03-apidocs/typealiasaxfieldvalue) 12 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxGenOut.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxGenOut 3 | --- 4 | 5 | > **AxGenOut**: `Record`\<`string`, [`AxFieldValue`](/api/#03-apidocs/typealiasaxfieldvalue)\> 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L32 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxGenerateResult.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxGenerateResult 3 | --- 4 | 5 | > **AxGenerateResult**\<`OUT`\>: `OUT` & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/generate.ts#L74 8 | 9 | ## Type declaration 10 | 11 | ### functions? 12 | 13 | > `optional` **functions**: [`AxChatResponseFunctionCall`](/api/#03-apidocs/typealiasaxchatresponsefunctioncall)[] 14 | 15 | ## Type Parameters 16 | 17 | | Type Parameter | 18 | | ------ | 19 | | `OUT` *extends* [`AxGenOut`](/api/#03-apidocs/typealiasaxgenout) | 20 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxIField.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxIField 3 | --- 4 | 5 | > **AxIField**: `Omit`\<[`AxField`](/api/#03-apidocs/interfaceaxfield), `"title"`\> & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/sig.ts#L35 8 | 9 | ## Type declaration 10 | 11 | ### title 12 | 13 | > **title**: `string` 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxInputFunctionType.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxInputFunctionType 3 | --- 4 | 5 | > **AxInputFunctionType**: [`AxFunction`](/api/#03-apidocs/typealiasaxfunction)[] \| `object`[] 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/functions.ts#L142 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxInternalChatRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxInternalChatRequest 3 | --- 4 | 5 | > **AxInternalChatRequest**\<`TModel`\>: `Omit`\<[`AxChatRequest`](/api/#03-apidocs/typealiasaxchatrequest), `"model"`\> & `Required`\<`Pick`\<[`AxChatRequest`](/api/#03-apidocs/typealiasaxchatrequest)\<`TModel`\>, `"model"`\>\> 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L204 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | 12 | | ------ | 13 | | `TModel` | 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxInternalEmbedRequest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxInternalEmbedRequest 3 | --- 4 | 5 | > **AxInternalEmbedRequest**\<`TEmbedModel`\>: `Omit`\<[`AxEmbedRequest`](/api/#03-apidocs/typealiasaxembedrequest), `"embedModel"`\> & `Required`\<`Pick`\<[`AxEmbedRequest`](/api/#03-apidocs/typealiasaxembedrequest)\<`TEmbedModel`\>, `"embedModel"`\>\> 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L212 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | 12 | | ------ | 13 | | `TEmbedModel` | 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxMetricFn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxMetricFn 3 | --- 4 | 5 | > **AxMetricFn**: \<`T`\>(`arg0`) => `boolean` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/optimize.ts#L15 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | Default type | 12 | | ------ | ------ | 13 | | `T` *extends* [`AxGenOut`](/api/#03-apidocs/typealiasaxgenout) | [`AxGenOut`](/api/#03-apidocs/typealiasaxgenout) | 14 | 15 | ## Parameters 16 | 17 | | Parameter | Type | 18 | | ------ | ------ | 19 | | `arg0` | `Readonly`\<\{ `example`: [`AxExample`](/api/#03-apidocs/typealiasaxexample); `prediction`: `T`; \}\> | 20 | 21 | ## Returns 22 | 23 | `boolean` 24 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxMetricFnArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxMetricFnArgs 3 | --- 4 | 5 | > **AxMetricFnArgs**: `Parameters`\<[`AxMetricFn`](/api/#03-apidocs/typealiasaxmetricfn)\>\[`0`\] 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/optimize.ts#L19 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxModelConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxModelConfig 3 | --- 4 | 5 | > **AxModelConfig**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L35 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### endSequences? 14 | 15 | > `optional` **endSequences**: `string`[] 16 | 17 | 18 | 19 | ### frequencyPenalty? 20 | 21 | > `optional` **frequencyPenalty**: `number` 22 | 23 | 24 | 25 | ### maxTokens? 26 | 27 | > `optional` **maxTokens**: `number` 28 | 29 | 30 | 31 | ### n? 32 | 33 | > `optional` **n**: `number` 34 | 35 | 36 | 37 | ### presencePenalty? 38 | 39 | > `optional` **presencePenalty**: `number` 40 | 41 | 42 | 43 | ### stopSequences? 44 | 45 | > `optional` **stopSequences**: `string`[] 46 | 47 | 48 | 49 | ### stream? 50 | 51 | > `optional` **stream**: `boolean` 52 | 53 | 54 | 55 | ### temperature? 56 | 57 | > `optional` **temperature**: `number` 58 | 59 | 60 | 61 | ### topK? 62 | 63 | > `optional` **topK**: `number` 64 | 65 | 66 | 67 | ### topP? 68 | 69 | > `optional` **topP**: `number` 70 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxModelInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxModelInfo 3 | --- 4 | 5 | > **AxModelInfo**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L20 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### aliases? 14 | 15 | > `optional` **aliases**: `string`[] 16 | 17 | 18 | 19 | ### characterIsToken? 20 | 21 | > `optional` **characterIsToken**: `boolean` 22 | 23 | 24 | 25 | ### completionTokenCostPer1M? 26 | 27 | > `optional` **completionTokenCostPer1M**: `number` 28 | 29 | 30 | 31 | ### currency? 32 | 33 | > `optional` **currency**: `string` 34 | 35 | 36 | 37 | ### name 38 | 39 | > **name**: `string` 40 | 41 | 42 | 43 | ### promptTokenCostPer1M? 44 | 45 | > `optional` **promptTokenCostPer1M**: `number` 46 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxModelInfoWithProvider.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxModelInfoWithProvider 3 | --- 4 | 5 | > **AxModelInfoWithProvider**: [`AxModelInfo`](/api/#03-apidocs/typealiasaxmodelinfo) & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L111 8 | 9 | ## Type declaration 10 | 11 | ### provider 12 | 13 | > **provider**: `string` 14 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxOptimizerArgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxOptimizerArgs 3 | --- 4 | 5 | > **AxOptimizerArgs**\<`IN`, `OUT`\>: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/optimize.ts#L21 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | 12 | | ------ | 13 | | `IN` *extends* [`AxGenIn`](/api/#03-apidocs/typealiasaxgenin) | 14 | | `OUT` *extends* [`AxGenOut`](/api/#03-apidocs/typealiasaxgenout) | 15 | 16 | ## Type declaration 17 | 18 | 19 | 20 | ### ai 21 | 22 | > **ai**: [`AxAIService`](/api/#03-apidocs/interfaceaxaiservice) 23 | 24 | 25 | 26 | ### examples 27 | 28 | > **examples**: `Readonly`\<[`AxExample`](/api/#03-apidocs/typealiasaxexample)[]\> 29 | 30 | ### options? 31 | 32 | > \{ `maxDemos`: `number`; `maxExamples`: `number`; `maxRounds`: `number`; \} 33 | 34 | 35 | 36 | ### program 37 | 38 | > **program**: `Readonly`\<[`AxProgram`](/api/#03-apidocs/classaxprogram)\<`IN`, `OUT`\>\> 39 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxProgramDemos.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxProgramDemos 3 | --- 4 | 5 | > **AxProgramDemos**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L40 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### programId 14 | 15 | > **programId**: `string` 16 | 17 | 18 | 19 | ### traces 20 | 21 | > **traces**: `Record`\<`string`, [`AxFieldValue`](/api/#03-apidocs/typealiasaxfieldvalue)\>[] 22 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxProgramExamples.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxProgramExamples 3 | --- 4 | 5 | > **AxProgramExamples**: [`AxProgramDemos`](/api/#03-apidocs/typealiasaxprogramdemos) \| [`AxProgramDemos`](/api/#03-apidocs/typealiasaxprogramdemos)\[`"traces"`\] 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L46 8 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxProgramTrace.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxProgramTrace 3 | --- 4 | 5 | > **AxProgramTrace**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L34 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### programId 14 | 15 | > **programId**: `string` 16 | 17 | 18 | 19 | ### trace 20 | 21 | > **trace**: `Record`\<`string`, [`AxFieldValue`](/api/#03-apidocs/typealiasaxfieldvalue)\> 22 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxProgramUsage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxProgramUsage 3 | --- 4 | 5 | > **AxProgramUsage**: [`AxChatResponse`](/api/#03-apidocs/typealiasaxchatresponse)\[`"modelUsage"`\] & `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/dsp/program.ts#L96 8 | 9 | ## Type declaration 10 | 11 | ### ai 12 | 13 | > **ai**: `string` 14 | 15 | ### model 16 | 17 | > **model**: `string` 18 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxRateLimiterFunction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRateLimiterFunction 3 | --- 4 | 5 | > **AxRateLimiterFunction**: \<`T`\>(`reqFunc`, `info`) => `Promise`\<`T` \| `ReadableStream`\<`T`\>\> 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L218 8 | 9 | ## Type Parameters 10 | 11 | | Type Parameter | Default type | 12 | | ------ | ------ | 13 | | `T` | `unknown` | 14 | 15 | ## Parameters 16 | 17 | | Parameter | Type | 18 | | ------ | ------ | 19 | | `reqFunc` | () => `Promise`\<`T` \| `ReadableStream`\<`T`\>\> | 20 | | `info` | `Readonly`\<\{ `embedModelUsage`: [`AxTokenUsage`](/api/#03-apidocs/typealiasaxtokenusage); `modelUsage`: [`AxTokenUsage`](/api/#03-apidocs/typealiasaxtokenusage); \}\> | 21 | 22 | ## Returns 23 | 24 | `Promise`\<`T` \| `ReadableStream`\<`T`\>\> 25 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxRerankerIn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRerankerIn 3 | --- 4 | 5 | > **AxRerankerIn**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L11 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### items 14 | 15 | > **items**: `string`[] 16 | 17 | 18 | 19 | ### query 20 | 21 | > **query**: `string` 22 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxRerankerOut.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRerankerOut 3 | --- 4 | 5 | > **AxRerankerOut**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L12 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### rankedItems 14 | 15 | > **rankedItems**: `string`[] 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxRewriteIn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRewriteIn 3 | --- 4 | 5 | > **AxRewriteIn**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L8 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### query 14 | 15 | > **query**: `string` 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxRewriteOut.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxRewriteOut 3 | --- 4 | 5 | > **AxRewriteOut**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/docs/manager.ts#L9 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### rewrittenQuery 14 | 15 | > **rewrittenQuery**: `string` 16 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/03-apidocs/TypeAlias.AxTokenUsage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AxTokenUsage 3 | --- 4 | 5 | > **AxTokenUsage**: `object` 6 | 7 | Defined in: https://github.com/ax-llm/ax/blob/76f1e53f33743ee460569bb94d0bd3620db6e328/src/ax/ai/types.ts#L29 8 | 9 | ## Type declaration 10 | 11 | 12 | 13 | ### completionTokens 14 | 15 | > **completionTokens**: `number` 16 | 17 | 18 | 19 | ### promptTokens 20 | 21 | > **promptTokens**: `number` 22 | 23 | 24 | 25 | ### totalTokens 26 | 27 | > **totalTokens**: `number` 28 | -------------------------------------------------------------------------------- /src/docs/src/content/docs/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Meet, Ax 3 | description: A framework to build LLM Agents. Multi-modal, Streaming, DSPy, Agents and much more. 4 | template: splash 5 | hero: 6 | tagline: A framework to build LLM Agents. Multi-modal, Streaming, DSPy, Agents and much more. 7 | image: 8 | file: ../../assets/spacy.jpg 9 | actions: 10 | - text: Quick Start 11 | link: ./start/quick/ 12 | icon: right-arrow 13 | variant: primary 14 | - text: Github Project 15 | link: https://github.com/ax-llm/ax 16 | icon: external 17 | --- 18 | -------------------------------------------------------------------------------- /src/docs/src/env.d.ts: -------------------------------------------------------------------------------- 1 | // cspell: disable 2 | 3 | // eslint-disable-next-line @typescript-eslint/triple-slash-reference 4 | /// 5 | /// 6 | -------------------------------------------------------------------------------- /src/docs/src/styles/custom.css: -------------------------------------------------------------------------------- 1 | /* :root { 2 | --sl-font: 'JetBrains Mono Variable', serif; 3 | } */ 4 | 5 | :root { 6 | font-size: 22px !important; 7 | 8 | --sl-font: 'Roboto', sans-serif; 9 | } 10 | 11 | /* Dark mode colors. */ 12 | :root { 13 | --sl-color-accent-low: rgb(0, 0, 0); 14 | --sl-color-accent: #000000; 15 | --sl-color-accent-high: #21c800; 16 | --sl-color-white: #ffffff; 17 | --sl-color-gray-1: #eceef2; 18 | --sl-color-gray-2: #c0c2c7; 19 | --sl-color-gray-3: #888b96; 20 | --sl-color-gray-4: #545861; 21 | --sl-color-gray-5: #353841; 22 | --sl-color-gray-6: #24272f; 23 | --sl-color-black: #17181c; 24 | } 25 | /* Light mode colors. */ 26 | :root[data-theme='light'] { 27 | --sl-color-accent-low: #96ff82; 28 | --sl-color-accent: #21c800; 29 | --sl-color-accent-high: #182775; 30 | --sl-color-white: #17181c; 31 | --sl-color-gray-1: #24272f; 32 | --sl-color-gray-2: #353841; 33 | --sl-color-gray-3: #545861; 34 | --sl-color-gray-4: #888b96; 35 | --sl-color-gray-5: #c0c2c7; 36 | --sl-color-gray-6: #eceef2; 37 | --sl-color-gray-7: #f5f6f8; 38 | --sl-color-black: #ffffff; 39 | } -------------------------------------------------------------------------------- /src/docs/tailwind.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | const plugin = require('tailwindcss/plugin') 3 | 4 | /** @type {import('tailwindcss').Config} */ 5 | export default { 6 | content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], 7 | theme: { 8 | extend: {}, 9 | }, 10 | plugins: [ 11 | require('@tailwindcss/typography'), 12 | plugin(function ({addVariant}) { 13 | addVariant( 14 | 'prose-inline-code', 15 | '&.prose :where(:not(pre)>code):not(:where([class~="not-prose"] *))' 16 | ); 17 | }) 18 | ], 19 | } 20 | -------------------------------------------------------------------------------- /src/docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tsconfig.json", "astro/tsconfigs/strict"] 3 | } 4 | -------------------------------------------------------------------------------- /src/examples/assets/kitten.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ax-llm/ax/8b26b7e43ca1221e8cfd180704f9e879ab52c314/src/examples/assets/kitten.jpeg -------------------------------------------------------------------------------- /src/examples/chain-of-thought.ts: -------------------------------------------------------------------------------- 1 | import { 2 | AxAI, 3 | AxAIGoogleGeminiModel, 4 | // AxAIGoogleGeminiModel, 5 | // AxAIOpenAI, 6 | AxChainOfThought, 7 | } from '@ax-llm/ax' 8 | 9 | const cot = new AxChainOfThought( 10 | ` 11 | context:string[] "Information to answer the question", 12 | question:string 13 | -> 14 | answer:string[]` 15 | ) 16 | 17 | const values = { 18 | question: 'What is the capital of France?', 19 | context: [ 20 | 'Paris is the capital and most populous city of France. Situated on the Seine River, in the north of the country, it is in the centre of the Île-de-France region, also known as the région parisienne, "Paris Region"', 21 | 'France is a unitary semi-presidential republic with its capital in Paris, the countrys largest city and main cultural and commercial centre; other major ', 22 | ], 23 | } 24 | 25 | const ai = new AxAI({ 26 | name: 'openai', 27 | apiKey: process.env.OPENAI_APIKEY as string, 28 | }) 29 | 30 | // const ai = new AxAI({ 31 | // name: 'ollama', 32 | // config: { stream: false } 33 | // }); 34 | 35 | // const ai = new AxAI({ 36 | // name: 'google-gemini', 37 | // apiKey: process.env.GOOGLE_APIKEY as string, 38 | // config: { model: AxAIGoogleGeminiModel.Gemini15Flash8B, stream: false }, 39 | // }) 40 | 41 | ai.setOptions({ debug: true }) 42 | 43 | const res = await cot.forward(ai, values) 44 | console.log(res) 45 | 46 | console.log(ai.getMetrics()) 47 | -------------------------------------------------------------------------------- /src/examples/docker.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxDockerSession, AxGen } from '@ax-llm/ax' 2 | 3 | // Initialize Docker session 4 | const dockerSession = new AxDockerSession() 5 | 6 | // Create a Docker container and execute the command sequence 7 | await dockerSession.findOrCreateContainer({ 8 | imageName: 'ubuntu:latest', 9 | tag: 'ax:example', 10 | }) 11 | 12 | // Define the task for generating a command sequence 13 | const prompt = new AxGen( 14 | `"Find requested file and display top 3 lines of its content and a hash of the file." 15 | fileQuery:string -> content:string, hash:string`, 16 | { functions: [dockerSession] } 17 | ) 18 | 19 | // Initialize the AI instance with your API key 20 | const ai = new AxAI({ 21 | name: 'openai', 22 | apiKey: process.env.OPENAI_APIKEY as string, 23 | }) 24 | ai.setOptions({ 25 | debug: true, 26 | }) 27 | 28 | // Execute the task 29 | const res = await prompt.forward(ai, { 30 | fileQuery: 'config file for current shell', 31 | }) 32 | 33 | console.log(res) 34 | 35 | // await dockerSession.stopContainers({ remove: true, tag: 'ax:example' }); 36 | -------------------------------------------------------------------------------- /src/examples/dope-or-nope.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | 3 | import { 4 | AxAI, 5 | AxBootstrapFewShot, 6 | AxChainOfThought, 7 | AxHFDataLoader, 8 | type AxMetricFn, 9 | } from '@ax-llm/ax' 10 | 11 | const hf = new AxHFDataLoader({ 12 | dataset: 'llm-wizard/dope_or_nope_v2', 13 | split: 'train', 14 | config: 'default', 15 | }) 16 | 17 | await hf.loadData() 18 | 19 | const examples = await hf.getRows<{ question: string; answer: number }>({ 20 | count: 5, 21 | fields: ['Sentence', 'Rating'], 22 | renameMap: { Sentence: 'question', Rating: 'answer' }, 23 | }) 24 | 25 | const ai = new AxAI({ 26 | name: 'openai', 27 | apiKey: process.env.OPENAI_APIKEY as string, 28 | }) 29 | 30 | // Setup the program to tune 31 | const program = new AxChainOfThought<{ question: string }, { answer: string }>( 32 | `question -> answer:number "numerical rating from 1 to 4"` 33 | ) 34 | 35 | // use examples if you have separate examples and tuning data sets without overlap. 36 | // program.setExamples(examples); 37 | 38 | const optimize = new AxBootstrapFewShot< 39 | { question: string }, 40 | { answer: string } 41 | >({ 42 | ai, 43 | program, 44 | examples, 45 | }) 46 | 47 | // Setup a evaluation metric em, f1 scores are a popular way measure retrieval performance. 48 | const metricFn: AxMetricFn = ({ prediction, example }) => { 49 | return prediction.answer === example.answer 50 | } 51 | 52 | // Run the optimizer 53 | const result = await optimize.compile(metricFn) 54 | 55 | // save the resulting demonstrations to use later 56 | const values = JSON.stringify(result, null, 2) 57 | await fs.promises.writeFile('./dope-or-nope-demos.json', values) 58 | 59 | console.log('> done. test with dope-or-nope.ts') 60 | -------------------------------------------------------------------------------- /src/examples/embed.ts: -------------------------------------------------------------------------------- 1 | import { AxAI } from '@ax-llm/ax' 2 | 3 | // Initialize the AI service with your API key 4 | const ai = new AxAI({ 5 | name: 'openai', // You can use 'anthropic', 'google-gemini', etc. 6 | apiKey: process.env.OPENAI_APIKEY as string, 7 | }) 8 | 9 | try { 10 | console.log('Generating embeddings for example text...') 11 | 12 | // Simple example: embedding a single string 13 | const result = await ai.embed({ 14 | texts: ['This is a sample text to embed.'], 15 | }) 16 | 17 | console.log('\nEmbedding results:') 18 | console.log(`- Number of embeddings: ${result.embeddings.length}`) 19 | 20 | // Check if we have a valid embedding 21 | if (result.embeddings.length > 0 && result.embeddings[0]) { 22 | const embedding = result.embeddings[0] 23 | console.log(`- Embedding dimensions: ${embedding.length}`) 24 | console.log(`- First few values: [${embedding.slice(0, 3).join(', ')}...]`) 25 | } 26 | 27 | // Display model usage information if available 28 | if (result.modelUsage) { 29 | console.log('\nModel usage information:') 30 | console.log(`- AI provider: ${result.modelUsage.ai}`) 31 | console.log(`- Model used: ${result.modelUsage.model}`) 32 | 33 | if (result.modelUsage.tokens) { 34 | console.log(`- Tokens used: ${JSON.stringify(result.modelUsage.tokens)}`) 35 | } 36 | } 37 | 38 | console.log('\nEmbeddings can be used for:') 39 | console.log('- Semantic search') 40 | console.log('- Document similarity comparison') 41 | console.log('- Clustering related content') 42 | console.log('- Building knowledge retrieval systems') 43 | } catch (error) { 44 | console.error('Error generating embeddings:', error) 45 | } 46 | -------------------------------------------------------------------------------- /src/examples/extract-test.ts: -------------------------------------------------------------------------------- 1 | 2 | import { AxAIGoogleGeminiModel, AxGen } from '@ax-llm/ax'; 3 | import { AxAI } from '@ax-llm/ax'; 4 | 5 | // Define the signature with the specific field names 6 | const signature = 'story:string -> intent:string, dogColors:string[], dogName:string, dogAge:string, dogBreed:string'; 7 | 8 | // Create the generator 9 | const gen = new AxGen<{ story: string }, { 10 | intent: string; 11 | dogColors: string[]; 12 | dogName: string; 13 | dogAge: string; 14 | dogBreed: string; 15 | }>(signature); 16 | 17 | // Create AI instance 18 | const ai = new AxAI({ 19 | name: 'google-gemini', 20 | apiKey: process.env.GOOGLE_APIKEY as string, 21 | config: { model: AxAIGoogleGeminiModel.Gemini15Flash8B }, 22 | }); 23 | 24 | // Test input 25 | const input = { 26 | story: 'Once upon a time, there was a dog named Luki. Luki was a golden retriever. Luki was 2 months old. The colors of his fur are golden, white and brown.', 27 | }; 28 | 29 | // Run the test with streamingForward 30 | console.log('Testing streamingForward with dog info fields...\n'); 31 | 32 | const generator = gen.streamingForward(ai, input); 33 | 34 | try { 35 | for await (const res of generator) { 36 | console.log('Streaming delta:', res); 37 | } 38 | 39 | } catch (error) { 40 | console.error('Error during streaming:', error); 41 | } 42 | 43 | try { 44 | const result = await gen.forward(ai, input); 45 | console.log('Result:', result); 46 | } catch (error) { 47 | console.error('Error during forward:', error); 48 | } 49 | -------------------------------------------------------------------------------- /src/examples/fibonacci.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxGen, AxJSInterpreter, AxSignature } from '@ax-llm/ax' 2 | 3 | const sig = new AxSignature( 4 | `numberSeriesTask:string -> fibonacciSeries:number[]` 5 | ) 6 | 7 | const gen = new AxGen<{ numberSeriesTask: string }>(sig, { 8 | functions: [new AxJSInterpreter()], 9 | }) 10 | 11 | const ai = new AxAI({ 12 | name: 'openai', 13 | apiKey: process.env.OPENAI_APIKEY as string, 14 | config: { stream: true }, 15 | }) 16 | 17 | const res = await gen.forward(ai, { 18 | numberSeriesTask: 'Use code to calculate the fibonacci series of 10', 19 | }) 20 | 21 | console.log('>', res) 22 | -------------------------------------------------------------------------------- /src/examples/marketing.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxGen } from '@ax-llm/ax' 2 | 3 | const product = { 4 | name: 'Acme Toilet Cleaning', 5 | description: '24/7 Commercial and residential restroom cleaning services', 6 | } 7 | 8 | const to = { 9 | name: 'Jerry Doe', 10 | title: 'Head of facilities and operations', 11 | company: 'Blue Yonder Inc.', 12 | } 13 | 14 | const messageGuidelines = [ 15 | 'Under 160 characters', 16 | 'Prompts recipients to book an call', 17 | 'Employs emojis and friendly language', 18 | ] 19 | 20 | const gen = new AxGen<{ 21 | productName: string 22 | productDescription: string 23 | toName: string 24 | toDescription: string 25 | messageGuidelines: string 26 | }>( 27 | `productName, productDescription, toName, toDescription, messageGuidelines -> message` 28 | ) 29 | 30 | const ai = new AxAI({ 31 | name: 'openai', 32 | apiKey: process.env.OPENAI_APIKEY as string, 33 | }) 34 | 35 | const res = await gen.forward(ai, { 36 | productName: product.name, 37 | productDescription: product.description, 38 | toName: to.name, 39 | toDescription: to.title, 40 | messageGuidelines: messageGuidelines.join(', '), 41 | }) 42 | 43 | console.log('>', res) 44 | -------------------------------------------------------------------------------- /src/examples/multi-modal.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs' 2 | 3 | import { AxAI, AxAIOpenAIModel, AxChainOfThought } from '@ax-llm/ax' 4 | 5 | const gen = new AxChainOfThought(`question, animalImage:image -> answer`) 6 | 7 | const image = fs 8 | .readFileSync('./src/examples/assets/kitten.jpeg') 9 | .toString('base64') 10 | 11 | const ai = new AxAI({ 12 | name: 'openai', 13 | apiKey: process.env.OPENAI_APIKEY as string, 14 | config: { model: AxAIOpenAIModel.GPT4O }, 15 | }) 16 | 17 | const res = await gen.forward(ai, { 18 | question: 'What family does this animal belong to?', 19 | animalImage: { mimeType: 'image/jpeg', data: image }, 20 | }) 21 | 22 | console.log('>', res) 23 | -------------------------------------------------------------------------------- /src/examples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ax-llm/ax-examples", 3 | "private": true, 4 | "type": "module", 5 | "description": "Examples for the best library to work with LLMs - Ax", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/ax-llm/ax.git" 9 | }, 10 | "license": "Apache-2.0", 11 | "keywords": [], 12 | "scripts": { 13 | "tsx": "node --env-file=.env --import=tsx" 14 | }, 15 | "dependencies": { 16 | "@ax-llm/ax": "11.0.49", 17 | "@opentelemetry/exporter-trace-otlp-http": "^0.201.1", 18 | "@opentelemetry/resources": "^2.0.1", 19 | "@opentelemetry/sdk-trace-base": "^2.0.1" 20 | }, 21 | "bugs": { 22 | "url": "https://github.com/@ax-llm/ax/issues" 23 | }, 24 | "homepage": "https://github.com/@ax-llm/ax#readme", 25 | "author": "Vikram " 26 | } 27 | -------------------------------------------------------------------------------- /src/examples/rag-docs.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxApacheTika, AxDBManager, AxDBMemory } from '@ax-llm/ax' 2 | 3 | const ai = new AxAI({ 4 | name: 'openai', 5 | apiKey: process.env.OPENAI_APIKEY as string, 6 | }) 7 | 8 | const db = new AxDBMemory() 9 | 10 | const tika = new AxApacheTika() 11 | 12 | const text = await tika.convert(['./README.md']) 13 | 14 | const manager = new AxDBManager({ ai, db }) 15 | await manager.insert(text, { 16 | minWordsPerChunk: 50, 17 | maxWordsPerChunk: 100, 18 | }) 19 | 20 | const matches = await manager.query('Explain semantic routing') 21 | const topMatch = matches.at(0) 22 | 23 | console.log(topMatch) 24 | -------------------------------------------------------------------------------- /src/examples/rag.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxChainOfThought, AxRAG } from '@ax-llm/ax' 2 | 3 | // simulated vector db call using an llm 4 | const fetchFromVectorDB = async (query: string) => { 5 | const cot = new AxChainOfThought<{ query: string }, { answer: string }>( 6 | 'query -> answer' 7 | ) 8 | const { answer } = await cot.forward(ai, { query }) 9 | return answer 10 | } 11 | 12 | const rag = new AxRAG(fetchFromVectorDB, { maxHops: 3 }) 13 | 14 | const ai = new AxAI({ 15 | name: 'openai', 16 | apiKey: process.env.OPENAI_APIKEY as string, 17 | }) 18 | 19 | const res = await rag.forward(ai, { 20 | question: 21 | 'List 3 of the top most important work done by Michael Stonebraker?', 22 | }) 23 | 24 | console.log(res) 25 | -------------------------------------------------------------------------------- /src/examples/react.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxReAct } from '@ax-llm/ax' 2 | 3 | const values = { 4 | question: 'What is the weather like in tokyo?', 5 | } 6 | 7 | const functions = [ 8 | { 9 | name: 'getCurrentWeather', 10 | description: 'get the current weather for a location', 11 | parameters: { 12 | type: 'object' as const, 13 | properties: { 14 | location: { 15 | type: 'string', 16 | description: 'location to get weather for', 17 | }, 18 | units: { 19 | type: 'string', 20 | enum: ['imperial', 'metric'], 21 | default: 'imperial', 22 | description: 'units to use', 23 | }, 24 | }, 25 | required: ['location'], 26 | }, 27 | 28 | func: async (args: Readonly<{ location: string; units: string }>) => { 29 | return `The weather in ${args.location} is 72 degrees` 30 | }, 31 | }, 32 | ] 33 | 34 | const cot = new AxReAct(`question:string -> answer:string`, { 35 | functions, 36 | }) 37 | 38 | const ai = new AxAI({ 39 | name: 'openai', 40 | apiKey: process.env.OPENAI_APIKEY as string, 41 | }) 42 | 43 | const res = await cot.forward(ai, values) 44 | console.log(res) 45 | -------------------------------------------------------------------------------- /src/examples/streaming1.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxAIGoogleGeminiModel, AxChainOfThought } from '@ax-llm/ax' 2 | 3 | // setup the prompt program 4 | const gen = new AxChainOfThought<{ startNumber: number }>( 5 | `startNumber:number -> next10Numbers:number[]` 6 | ) 7 | 8 | // add a assertion to ensure that the number 5 is not in an output field 9 | gen.addAssert(({ next10Numbers }: Readonly<{ next10Numbers: number[] }>) => { 10 | return next10Numbers ? !next10Numbers.includes(5) : undefined 11 | }, 'Numbers 5 is not allowed') 12 | 13 | gen.addAssert(({ next10Numbers }: Readonly<{ next10Numbers: number[] }>) => { 14 | return next10Numbers ? !next10Numbers.includes(2) : undefined 15 | }, 'Numbers 2 is not allowed') 16 | 17 | // const ai = new AxAI({ 18 | // name: 'openai', 19 | // apiKey: process.env.OPENAI_APIKEY as string, 20 | // }) 21 | 22 | const ai = new AxAI({ 23 | name: 'google-gemini', 24 | apiKey: process.env.GOOGLE_APIKEY as string, 25 | config: { model: AxAIGoogleGeminiModel.Gemini20FlashLite }, 26 | }) 27 | ai.setOptions({ debug: true }) 28 | 29 | // run the program with streaming enabled 30 | const res = await gen.forward(ai, { startNumber: 1 }) 31 | 32 | console.log('>', res) 33 | -------------------------------------------------------------------------------- /src/examples/streaming2.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxAIOpenAIModel, AxChainOfThought } from '@ax-llm/ax' 2 | 3 | // const ai = new AxAI({ 4 | // name: 'anthropic' 5 | // apiKey: process.env.ANTHROPIC_APIKEY as string 6 | // }); 7 | 8 | // setup the prompt program 9 | const gen = new AxChainOfThought<{ question: string }>( 10 | `question:string -> answerInPoints:string` 11 | ) 12 | 13 | // add a assertion to ensure all lines start with a number and a dot. 14 | gen.addStreamingAssert( 15 | 'answerInPoints', 16 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 17 | (value: string, _done?: boolean) => { 18 | const re = /^\d+\./ 19 | 20 | // split the value by lines, trim each line, 21 | // filter out very short lines and check if all lines match the regex 22 | return value 23 | .split('\n') 24 | .map((x) => x.trim()) 25 | .filter((x) => x.length > 4) 26 | .every((x) => re.test(x)) 27 | }, 28 | 'Lines must start with a number and a dot. Eg: 1. This is a line.' 29 | ) 30 | 31 | const ai = new AxAI({ 32 | name: 'openai', 33 | apiKey: process.env.OPENAI_APIKEY as string, 34 | config: { model: AxAIOpenAIModel.GPT4OMini }, 35 | }) 36 | ai.setOptions({ debug: true }) 37 | 38 | // run the program with streaming enabled 39 | const res = await gen.forward(ai, { 40 | question: 41 | 'Provide a list of 3 optimizations to speedup LLM inference. Keep it short a few words each', 42 | }) 43 | 44 | console.log('>', res) 45 | -------------------------------------------------------------------------------- /src/examples/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tsconfig.json"] 3 | } 4 | -------------------------------------------------------------------------------- /src/examples/tune-bootstrap.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | 3 | import { 4 | AxAI, 5 | AxChainOfThought, 6 | AxEvalUtil, 7 | AxHFDataLoader, 8 | type AxMetricFn, 9 | AxTestPrompt, 10 | } from '@ax-llm/ax' 11 | 12 | const program = new AxChainOfThought<{ question: string }, { answer: string }>( 13 | `question -> answer "in short 2 or 3 words"` 14 | ) 15 | 16 | const values = await fs.promises.readFile('./qna-tune-demos.json', 'utf8') 17 | const demos = JSON.parse(values) 18 | 19 | // load tuning data 20 | program.setDemos(demos) 21 | 22 | // use directly 23 | // const res = await gen.forward({ 24 | // question: 'What castle did David Gregory inherit?' 25 | // }); 26 | 27 | // or test to see performance 28 | const hf = new AxHFDataLoader({ 29 | // cspell: disable-next-line 30 | dataset: 'yixuantt/MultiHopRAG', 31 | split: 'train', 32 | config: 'MultiHopRAG', 33 | options: { length: 20 }, 34 | }) 35 | 36 | await hf.loadData() 37 | 38 | const examples = await hf.getRows<{ question: string; answer: string }>({ 39 | count: 10, 40 | fields: ['query', 'answer'], 41 | renameMap: { query: 'question', answer: 'answer' }, 42 | }) 43 | 44 | // Setup a evaluation metric em, f1 scores are a popular way measure retrieval performance. 45 | const metricFn: AxMetricFn = ({ prediction, example }) => { 46 | return AxEvalUtil.emScore( 47 | prediction.answer as string, 48 | example.answer as string 49 | ) 50 | } 51 | 52 | const ai = new AxAI({ 53 | name: 'openai', 54 | apiKey: process.env.OPENAI_APIKEY as string, 55 | }) 56 | 57 | const ev = new AxTestPrompt({ ai, program, examples }) 58 | await ev.run(metricFn) 59 | -------------------------------------------------------------------------------- /src/examples/vectordb.ts: -------------------------------------------------------------------------------- 1 | import { AxAI, AxDBManager, AxDBMemory } from '@ax-llm/ax' 2 | 3 | /* cSpell:disable */ 4 | const text = `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 consequences for human civilization.[2][3] According to the most popular version of the singularity hypothesis, I. J. Good's intelligence explosion model, an upgradable intelligent agent will eventually enter a positive feedback loop of self-improvement cycles, each new and more intelligent generation appearing more and more rapidly, causing a rapid increase ("explosion") in intelligence which ultimately results in a powerful superintelligence that qualitatively far surpasses all human intelligence.[4] 5 | 6 | One of the most successful early gastromancers was Eurykles, a prophet at Athens; gastromancers came to be referred to as Euryklides in his honour.[3] Other parts of the world also have a tradition of ventriloquism for ritual or religious purposes; historically there have been adepts of this practice among the Zulu, Inuit, and Māori peoples.[3] 7 | ` 8 | 9 | const ai = new AxAI({ 10 | name: 'openai', 11 | apiKey: process.env.OPENAI_APIKEY as string, 12 | }) 13 | 14 | const db = new AxDBMemory() 15 | 16 | const manager = new AxDBManager({ ai, db }) 17 | 18 | await manager.insert(text) 19 | 20 | const res = await manager.query( 21 | 'John von Neumann on human intelligence and singularity.' 22 | ) 23 | console.log(res) 24 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@total-typescript/tsconfig/tsc/no-dom/library", 3 | "compilerOptions": { 4 | "jsx": "react", 5 | "esModuleInterop": true, 6 | "moduleResolution": "NodeNext", 7 | "outDir": "build/module", 8 | "pretty": true, 9 | "baseUrl": ".", 10 | "paths": { 11 | "@ax-llm/*": ["src/*"] 12 | } 13 | }, 14 | "exclude": ["node_modules/**", "dist/**", "src/*/dist/**"] 15 | } 16 | -------------------------------------------------------------------------------- /typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://typedoc.org/schema.json", 3 | "plugin": [ 4 | "typedoc-plugin-markdown", 5 | "typedoc-plugin-frontmatter", 6 | "./customFrontmatter.mjs" 7 | ], 8 | "pretty": true, 9 | "cleanOutputDir": true, 10 | "hidePageTitle": true, 11 | "hideGroupHeadings": true, 12 | "parametersFormat": "table", 13 | "typeDeclarationVisibility": "compact", 14 | "hidePageHeader": true, 15 | "hideBreadcrumbs": true, 16 | "useHTMLAnchors": true, 17 | "preserveAnchorCasing": true, 18 | "excludePrivate": true, 19 | "excludeProtected": true, 20 | "flattenOutputFiles": true, 21 | "mergeReadme": false 22 | } 23 | --------------------------------------------------------------------------------