@adaline/groq 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +26 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChatModelSchemaType, ParamsType, ProviderV1, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1 } from '@adaline/provider';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { BaseChatModel } from '@adaline/openai';
|
|
4
4
|
import { MessageType } from '@adaline/types';
|
|
5
5
|
|
|
6
|
-
declare class Groq<O extends Record<string, any> = Record<string, any>> implements ProviderV1<O> {
|
|
7
|
-
readonly version: "v1";
|
|
8
|
-
readonly name = "groq";
|
|
9
|
-
static readonly baseUrl = "https://api.groq.com/openai/v1";
|
|
10
|
-
private readonly chatModelFactories;
|
|
11
|
-
private readonly embeddingModelFactories;
|
|
12
|
-
chatModelLiterals(): string[];
|
|
13
|
-
chatModelSchemas(): Record<string, ChatModelSchemaType>;
|
|
14
|
-
chatModel(options: O): ChatModelV1;
|
|
15
|
-
embeddingModelLiterals(): string[];
|
|
16
|
-
embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType>;
|
|
17
|
-
embeddingModel(options: O): EmbeddingModelV1;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
6
|
declare const BaseChatModelOptions: z.ZodObject<{
|
|
21
7
|
modelName: z.ZodString;
|
|
22
8
|
apiKey: z.ZodString;
|
|
@@ -843,4 +829,18 @@ declare class Llama_3_1_8b extends BaseChatModelGroq {
|
|
|
843
829
|
constructor(options: Llama_3_1_8b_OptionsType);
|
|
844
830
|
}
|
|
845
831
|
|
|
832
|
+
declare class Groq<C extends BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {
|
|
833
|
+
readonly version: "v1";
|
|
834
|
+
readonly name = "groq";
|
|
835
|
+
static readonly baseUrl = "https://api.groq.com/openai/v1";
|
|
836
|
+
private readonly chatModelFactories;
|
|
837
|
+
private readonly embeddingModelFactories;
|
|
838
|
+
chatModelLiterals(): string[];
|
|
839
|
+
chatModelSchemas(): Record<string, ChatModelSchemaType>;
|
|
840
|
+
chatModel(options: C): ChatModelV1;
|
|
841
|
+
embeddingModelLiterals(): string[];
|
|
842
|
+
embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType>;
|
|
843
|
+
embeddingModel(options: E): EmbeddingModelV1;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
846
|
export { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType, Gemma2_9b_IT, Gemma2_9b_ITLiteral, Gemma2_9b_ITOptions, type Gemma2_9b_ITOptionsType, Gemma2_9b_ITSchema, Gemma_7b_IT, Gemma_7b_ITLiteral, Gemma_7b_ITOptions, type Gemma_7b_ITOptionsType, Gemma_7b_ITSchema, Groq, LlamaGuard_3_8b, LlamaGuard_3_8bLiteral, LlamaGuard_3_8bOptions, type LlamaGuard_3_8bOptionsType, LlamaGuard_3_8bSchema, Llama_3_1_70b, Llama_3_1_70bLiteral, Llama_3_1_70bSchema, Llama_3_1_70b_Options, type Llama_3_1_70b_OptionsType, Llama_3_1_8b, Llama_3_1_8bLiteral, Llama_3_1_8bSchema, Llama_3_1_8b_Options, type Llama_3_1_8b_OptionsType, Llama_3_2_11b_Vision, Llama_3_2_11b_VisionLiteral, Llama_3_2_11b_VisionOptions, type Llama_3_2_11b_VisionOptionsType, Llama_3_2_11b_VisionSchema, Llama_3_2_1b, Llama_3_2_1bLiteral, Llama_3_2_1bSchema, Llama_3_2_1b_Options, type Llama_3_2_1b_OptionsType, Llama_3_2_3b, Llama_3_2_3bLiteral, Llama_3_2_3bSchema, Llama_3_2_3b_Options, type Llama_3_2_3b_OptionsType, Llama_3_70b, Llama_3_70bLiteral, Llama_3_70bOptions, type Llama_3_70bOptionsType, Llama_3_70bSchema, Llama_3_70b_Tool_Use, Llama_3_70b_Tool_UseLiteral, Llama_3_70b_Tool_UseSchema, Llama_3_70b_Tool_Use_Options, type Llama_3_70b_Tool_Use_OptionsType, Llama_3_8b, Llama_3_8bLiteral, Llama_3_8bOptions, type Llama_3_8bOptionsType, Llama_3_8bSchema, Llama_3_8b_Tool_Use, Llama_3_8b_Tool_UseLiteral, Llama_3_8b_Tool_UseSchema, Llama_3_8b_Tool_Use_Options, type Llama_3_8b_Tool_Use_OptionsType, Mixtral_8x7b, Mixtral_8x7bLiteral, Mixtral_8x7bOptions, type Mixtral_8x7bOptionsType, Mixtral_8x7bSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChatModelSchemaType, ParamsType, ProviderV1, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1 } from '@adaline/provider';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { BaseChatModel } from '@adaline/openai';
|
|
4
4
|
import { MessageType } from '@adaline/types';
|
|
5
5
|
|
|
6
|
-
declare class Groq<O extends Record<string, any> = Record<string, any>> implements ProviderV1<O> {
|
|
7
|
-
readonly version: "v1";
|
|
8
|
-
readonly name = "groq";
|
|
9
|
-
static readonly baseUrl = "https://api.groq.com/openai/v1";
|
|
10
|
-
private readonly chatModelFactories;
|
|
11
|
-
private readonly embeddingModelFactories;
|
|
12
|
-
chatModelLiterals(): string[];
|
|
13
|
-
chatModelSchemas(): Record<string, ChatModelSchemaType>;
|
|
14
|
-
chatModel(options: O): ChatModelV1;
|
|
15
|
-
embeddingModelLiterals(): string[];
|
|
16
|
-
embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType>;
|
|
17
|
-
embeddingModel(options: O): EmbeddingModelV1;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
6
|
declare const BaseChatModelOptions: z.ZodObject<{
|
|
21
7
|
modelName: z.ZodString;
|
|
22
8
|
apiKey: z.ZodString;
|
|
@@ -843,4 +829,18 @@ declare class Llama_3_1_8b extends BaseChatModelGroq {
|
|
|
843
829
|
constructor(options: Llama_3_1_8b_OptionsType);
|
|
844
830
|
}
|
|
845
831
|
|
|
832
|
+
declare class Groq<C extends BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {
|
|
833
|
+
readonly version: "v1";
|
|
834
|
+
readonly name = "groq";
|
|
835
|
+
static readonly baseUrl = "https://api.groq.com/openai/v1";
|
|
836
|
+
private readonly chatModelFactories;
|
|
837
|
+
private readonly embeddingModelFactories;
|
|
838
|
+
chatModelLiterals(): string[];
|
|
839
|
+
chatModelSchemas(): Record<string, ChatModelSchemaType>;
|
|
840
|
+
chatModel(options: C): ChatModelV1;
|
|
841
|
+
embeddingModelLiterals(): string[];
|
|
842
|
+
embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType>;
|
|
843
|
+
embeddingModel(options: E): EmbeddingModelV1;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
846
|
export { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType, Gemma2_9b_IT, Gemma2_9b_ITLiteral, Gemma2_9b_ITOptions, type Gemma2_9b_ITOptionsType, Gemma2_9b_ITSchema, Gemma_7b_IT, Gemma_7b_ITLiteral, Gemma_7b_ITOptions, type Gemma_7b_ITOptionsType, Gemma_7b_ITSchema, Groq, LlamaGuard_3_8b, LlamaGuard_3_8bLiteral, LlamaGuard_3_8bOptions, type LlamaGuard_3_8bOptionsType, LlamaGuard_3_8bSchema, Llama_3_1_70b, Llama_3_1_70bLiteral, Llama_3_1_70bSchema, Llama_3_1_70b_Options, type Llama_3_1_70b_OptionsType, Llama_3_1_8b, Llama_3_1_8bLiteral, Llama_3_1_8bSchema, Llama_3_1_8b_Options, type Llama_3_1_8b_OptionsType, Llama_3_2_11b_Vision, Llama_3_2_11b_VisionLiteral, Llama_3_2_11b_VisionOptions, type Llama_3_2_11b_VisionOptionsType, Llama_3_2_11b_VisionSchema, Llama_3_2_1b, Llama_3_2_1bLiteral, Llama_3_2_1bSchema, Llama_3_2_1b_Options, type Llama_3_2_1b_OptionsType, Llama_3_2_3b, Llama_3_2_3bLiteral, Llama_3_2_3bSchema, Llama_3_2_3b_Options, type Llama_3_2_3b_OptionsType, Llama_3_70b, Llama_3_70bLiteral, Llama_3_70bOptions, type Llama_3_70bOptionsType, Llama_3_70bSchema, Llama_3_70b_Tool_Use, Llama_3_70b_Tool_UseLiteral, Llama_3_70b_Tool_UseSchema, Llama_3_70b_Tool_Use_Options, type Llama_3_70b_Tool_Use_OptionsType, Llama_3_8b, Llama_3_8bLiteral, Llama_3_8bOptions, type Llama_3_8bOptionsType, Llama_3_8bSchema, Llama_3_8b_Tool_Use, Llama_3_8b_Tool_UseLiteral, Llama_3_8b_Tool_UseSchema, Llama_3_8b_Tool_Use_Options, type Llama_3_8b_Tool_Use_OptionsType, Mixtral_8x7b, Mixtral_8x7bLiteral, Mixtral_8x7bOptions, type Mixtral_8x7bOptionsType, Mixtral_8x7bSchema };
|
package/dist/index.js
CHANGED
|
@@ -4,65 +4,65 @@ var provider = require('@adaline/provider');
|
|
|
4
4
|
var zod = require('zod');
|
|
5
5
|
var openai = require('@adaline/openai');
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
`)):
|
|
9
|
-
`));}),r}};var I=provider.RangeConfigItem({param:"temperature",title:provider.CHAT_CONFIG.TEMPERATURE.title,description:provider.CHAT_CONFIG.TEMPERATURE.description,min:0,max:2,step:.01,default:1}),S=a=>provider.RangeConfigItem({param:"max_tokens",title:provider.CHAT_CONFIG.MAX_TOKENS.title,description:provider.CHAT_CONFIG.MAX_TOKENS.description,min:0,max:a,step:1,default:0}),G=provider.MultiStringConfigItem({param:"stop",title:provider.CHAT_CONFIG.STOP(4).title,description:provider.CHAT_CONFIG.STOP(4).description,max:4}),A=provider.RangeConfigItem({param:"top_p",title:provider.CHAT_CONFIG.TOP_P.title,description:provider.CHAT_CONFIG.TOP_P.description,min:0,max:1,step:.01,default:1}),E=provider.RangeConfigItem({param:"frequency_penalty",title:provider.CHAT_CONFIG.FREQUENCY_PENALTY.title,description:provider.CHAT_CONFIG.FREQUENCY_PENALTY.description,min:-2,max:2,step:.01,default:0}),R=provider.RangeConfigItem({param:"presence_penalty",title:provider.CHAT_CONFIG.PRESENCE_PENALTY.title,description:provider.CHAT_CONFIG.PRESENCE_PENALTY.description,min:-2,max:2,step:.01,default:0}),q=provider.RangeConfigItem({param:"seed",title:provider.CHAT_CONFIG.SEED.title,description:provider.CHAT_CONFIG.SEED.description,min:0,max:1e6,step:1,default:0}),B=provider.SelectStringConfigItem({param:"response_format",title:provider.CHAT_CONFIG.RESPONSE_FORMAT.title,description:provider.CHAT_CONFIG.RESPONSE_FORMAT.description,default:"text",choices:["text","json_object"]}),k=provider.SelectStringConfigItem({param:"tool_choice",title:"Tool choice",description:"Controls which (if any) tool is called by the model. 'none' means the model will not call a function. 'auto' means the model can pick between generating a message or calling a tool.",default:"auto",choices:["auto","required","none"]});var _e=a=>zod.z.object({temperature:I.schema,maxTokens:S(a).schema,stop:G.schema,topP:A.schema,frequencyPenalty:E.schema,presencePenalty:R.schema,seed:q.schema.transform(e=>e===0?void 0:e),responseFormat:B.schema,toolChoice:k.schema}),he=a=>({temperature:I.def,maxTokens:S(a).def,stop:G.def,topP:A.def,frequencyPenalty:E.def,presencePenalty:R.def,seed:q.def,responseFormat:B.def,toolChoice:k.def});var o={base:a=>({def:he(a),schema:_e(a)})};var z="gemma-7b-it",Fe="Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models.",v=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:z,description:Fe,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),fe=n,c=class extends s{constructor(e){super(v,e);}};var P="gemma2-9b-it",$e="Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models.",U=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:P,description:$e,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),be=n,_=class extends s{constructor(e){super(U,e);}};var N="mixtral-8x7b-32768",We="The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts.",w=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:N,description:We,maxInputTokens:32768,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ue=n,h=class extends s{constructor(e){super(w,e);}};var F="llama-guard-3-8b",no="Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.",V=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:F,description:no,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Me=n,f=class extends s{constructor(e){super(V,e);}};var D="llama3-8b-8192",co="The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",j=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:D,description:co,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Te=n,b=class extends s{constructor(e){super(j,e);}};var K="llama3-70b-8192",Mo="The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",Y=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:K,description:Mo,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Oe=n,u=class extends s{constructor(e){super(Y,e);}};var $="llama3-groq-70b-8192-tool-use-preview",xo="This is the 70B parameter version of the Llama 3 Groq Tool Use model, specifically designed for advanced tool use and function calling tasks.",Q=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:$,description:xo,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ye=n,M=class extends s{constructor(e){super(Q,e);}};var X="llama3-groq-8b-8192-tool-use-preview",Eo="This is the 8B parameter version of the Llama 3 Groq Tool Use model, specifically designed for advanced tool use and function calling tasks.",Z=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:X,description:Eo,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Ce=n,T=class extends s{constructor(e){super(Z,e);}};var H="llama-3.2-11b-vision-preview",vo="The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The models outperform many of the available open source and closed multimodal models on common industry benchmarks.",J=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelModalitiesEnum).parse({name:H,description:vo,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Le=n,O=class extends s{constructor(e){super(J,e);}};var W="llama-3.2-3b-preview",Vo="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",ee=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:W,description:Vo,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),xe=n,y=class extends s{constructor(e){super(ee,e);}};var oe="llama-3.2-1b-preview",Qo="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",ae=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:oe,description:Qo,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ge=n,C=class extends s{constructor(e){super(ae,e);}};var te="llama-3.1-70b-versatile",ea="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",se=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:te,description:ea,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Ie=n,L=class extends s{constructor(e){super(se,e);}};var ne="llama-3.1-8b-instant",ma="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",me=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:ne,description:ma,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Se=n,x=class extends s{constructor(e){super(me,e);}};var ia="groq",d=class{constructor(){this.version="v1";this.name=ia;this.chatModelFactories={[z]:{model:c,modelOptions:fe,modelSchema:v},[P]:{model:_,modelOptions:be,modelSchema:U},[F]:{model:f,modelOptions:Me,modelSchema:V},[D]:{model:b,modelOptions:Te,modelSchema:j},[K]:{model:u,modelOptions:Oe,modelSchema:Y},[ne]:{model:x,modelOptions:Se,modelSchema:me},[X]:{model:T,modelOptions:Ce,modelSchema:Z},[te]:{model:L,modelOptions:Ie,modelSchema:se},[$]:{model:M,modelOptions:ye,modelSchema:Q},[H]:{model:O,modelOptions:Le,modelSchema:J},[W]:{model:y,modelOptions:xe,modelSchema:ee},[oe]:{model:C,modelOptions:ge,modelSchema:ae},[N]:{model:h,modelOptions:ue,modelSchema:w}};this.embeddingModelFactories={};}chatModelLiterals(){return Object.keys(this.chatModelFactories)}chatModelSchemas(){return Object.keys(this.chatModelFactories).reduce((e,t)=>(e[t]=this.chatModelFactories[t].modelSchema,e),{})}chatModel(e){let t=e.modelName;if(!t)throw new provider.ProviderError({info:"options.modelName is required",cause:new Error("options.modelName is required")});if(!(t in this.chatModelFactories))throw new provider.ProviderError({info:`Groq chat model: ${t} not found`,cause:new Error(`Groq chat model: ${t} not found, available chat models:
|
|
10
|
-
${this.chatModelLiterals().join(", ")}`)});let r=this.chatModelFactories[
|
|
7
|
+
var t=zod.z.object({modelName:zod.z.string().min(1),apiKey:zod.z.string().min(1)}),a=class extends openai.BaseChatModel{constructor(l,r){let n=t.parse(r),i=d.baseUrl;super(l,{modelName:n.modelName,apiKey:n.apiKey,baseUrl:i,completeChatUrl:`${i}/chat/completions`,streamChatUrl:`${i}/chat/completions`});this.version="v1";this.modelSchema=l,this.modelName=n.modelName,this.groqApiKey=n.apiKey;}transformMessages(l){let r=super.transformMessages(l);return r.messages.forEach(n=>{n.role==="system"?typeof n.content!="string"&&(n.content=n.content.map(i=>i.text).join(`
|
|
8
|
+
`)):n.role==="assistant"&&n.content&&typeof n.content!="string"&&(n.content=n.content.map(i=>i.text).join(`
|
|
9
|
+
`));}),r}};var I=provider.RangeConfigItem({param:"temperature",title:provider.CHAT_CONFIG.TEMPERATURE.title,description:provider.CHAT_CONFIG.TEMPERATURE.description,min:0,max:2,step:.01,default:1}),S=s=>provider.RangeConfigItem({param:"max_tokens",title:provider.CHAT_CONFIG.MAX_TOKENS.title,description:provider.CHAT_CONFIG.MAX_TOKENS.description,min:0,max:s,step:1,default:0}),G=provider.MultiStringConfigItem({param:"stop",title:provider.CHAT_CONFIG.STOP(4).title,description:provider.CHAT_CONFIG.STOP(4).description,max:4}),A=provider.RangeConfigItem({param:"top_p",title:provider.CHAT_CONFIG.TOP_P.title,description:provider.CHAT_CONFIG.TOP_P.description,min:0,max:1,step:.01,default:1}),E=provider.RangeConfigItem({param:"frequency_penalty",title:provider.CHAT_CONFIG.FREQUENCY_PENALTY.title,description:provider.CHAT_CONFIG.FREQUENCY_PENALTY.description,min:-2,max:2,step:.01,default:0}),R=provider.RangeConfigItem({param:"presence_penalty",title:provider.CHAT_CONFIG.PRESENCE_PENALTY.title,description:provider.CHAT_CONFIG.PRESENCE_PENALTY.description,min:-2,max:2,step:.01,default:0}),q=provider.RangeConfigItem({param:"seed",title:provider.CHAT_CONFIG.SEED.title,description:provider.CHAT_CONFIG.SEED.description,min:0,max:1e6,step:1,default:0}),B=provider.SelectStringConfigItem({param:"response_format",title:provider.CHAT_CONFIG.RESPONSE_FORMAT.title,description:provider.CHAT_CONFIG.RESPONSE_FORMAT.description,default:"text",choices:["text","json_object"]}),k=provider.SelectStringConfigItem({param:"tool_choice",title:"Tool choice",description:"Controls which (if any) tool is called by the model. 'none' means the model will not call a function. 'auto' means the model can pick between generating a message or calling a tool.",default:"auto",choices:["auto","required","none"]});var ie=s=>zod.z.object({temperature:I.schema,maxTokens:S(s).schema,stop:G.schema,topP:A.schema,frequencyPenalty:E.schema,presencePenalty:R.schema,seed:q.schema.transform(e=>e===0?void 0:e),responseFormat:B.schema,toolChoice:k.schema}),re=s=>({temperature:I.def,maxTokens:S(s).def,stop:G.def,topP:A.def,frequencyPenalty:E.def,presencePenalty:R.def,seed:q.def,responseFormat:B.def,toolChoice:k.def});var o={base:s=>({def:re(s),schema:ie(s)})};var z="gemma-7b-it",qe="Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models.",v=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:z,description:qe,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),pe=t,c=class extends a{constructor(e){super(v,e);}};var P="gemma2-9b-it",Ue="Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models.",U=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:P,description:Ue,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),de=t,_=class extends a{constructor(e){super(U,e);}};var N="mixtral-8x7b-32768",je="The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts.",w=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:N,description:je,maxInputTokens:32768,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ce=t,h=class extends a{constructor(e){super(w,e);}};var F="llama-guard-3-8b",Ze="Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.",V=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:F,description:Ze,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),_e=t,M=class extends a{constructor(e){super(V,e);}};var D="llama3-8b-8192",ao="The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",j=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:D,description:ao,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),he=t,f=class extends a{constructor(e){super(j,e);}};var K="llama3-70b-8192",io="The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",Y=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:K,description:io,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Me=t,b=class extends a{constructor(e){super(Y,e);}};var $="llama3-groq-70b-8192-tool-use-preview",Mo="This is the 70B parameter version of the Llama 3 Groq Tool Use model, specifically designed for advanced tool use and function calling tasks.",Q=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:$,description:Mo,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),fe=t,T=class extends a{constructor(e){super(Q,e);}};var X="llama3-groq-8b-8192-tool-use-preview",yo="This is the 8B parameter version of the Llama 3 Groq Tool Use model, specifically designed for advanced tool use and function calling tasks.",Z=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:X,description:yo,maxInputTokens:8192,maxOutputTokens:4096,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),be=t,u=class extends a{constructor(e){super(Z,e);}};var H="llama-3.2-11b-vision-preview",So="The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The models outperform many of the available open source and closed multimodal models on common industry benchmarks.",J=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelModalitiesEnum).parse({name:H,description:So,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Te=t,O=class extends a{constructor(e){super(J,e);}};var W="llama-3.2-3b-preview",Bo="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",ee=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:W,description:Bo,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ue=t,y=class extends a{constructor(e){super(ee,e);}};var oe="llama-3.2-1b-preview",No="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",ae=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:oe,description:No,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Oe=t,C=class extends a{constructor(e){super(ae,e);}};var te="llama-3.1-70b-versatile",Ko="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",se=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:te,description:Ko,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ye=t,L=class extends a{constructor(e){super(se,e);}};var le="llama-3.1-8b-instant",Ho="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",ne=provider.ChatModelSchema(openai.OpenAIChatModelRoles,openai.OpenAIChatModelTextToolModalitiesEnum).parse({name:le,description:Ho,maxInputTokens:128e3,maxOutputTokens:8192,roles:openai.OpenAIChatModelRolesMap,modalities:openai.OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Ce=t,x=class extends a{constructor(e){super(ne,e);}};var Jo="groq",d=class{constructor(){this.version="v1";this.name=Jo;this.chatModelFactories={[z]:{model:c,modelOptions:pe,modelSchema:v},[P]:{model:_,modelOptions:de,modelSchema:U},[F]:{model:M,modelOptions:_e,modelSchema:V},[D]:{model:f,modelOptions:he,modelSchema:j},[K]:{model:b,modelOptions:Me,modelSchema:Y},[le]:{model:x,modelOptions:Ce,modelSchema:ne},[X]:{model:u,modelOptions:be,modelSchema:Z},[te]:{model:L,modelOptions:ye,modelSchema:se},[$]:{model:T,modelOptions:fe,modelSchema:Q},[H]:{model:O,modelOptions:Te,modelSchema:J},[W]:{model:y,modelOptions:ue,modelSchema:ee},[oe]:{model:C,modelOptions:Oe,modelSchema:ae},[N]:{model:h,modelOptions:ce,modelSchema:w}};this.embeddingModelFactories={};}chatModelLiterals(){return Object.keys(this.chatModelFactories)}chatModelSchemas(){return Object.keys(this.chatModelFactories).reduce((e,l)=>(e[l]=this.chatModelFactories[l].modelSchema,e),{})}chatModel(e){let l=e.modelName;if(!(l in this.chatModelFactories))throw new provider.ProviderError({info:`Groq chat model: ${l} not found`,cause:new Error(`Groq chat model: ${l} not found, available chat models:
|
|
10
|
+
${this.chatModelLiterals().join(", ")}`)});let r=this.chatModelFactories[l].model,n=this.chatModelFactories[l].modelOptions.parse(e);return new r(n)}embeddingModelLiterals(){return Object.keys(this.embeddingModelFactories)}embeddingModelSchemas(){return Object.keys(this.embeddingModelFactories).reduce((e,l)=>(e[l]=this.embeddingModelFactories[l].modelSchema,e),{})}embeddingModel(e){throw new provider.ProviderError({info:"Groq does not support embedding models yet",cause:new Error("Groq does not support embedding models yet")})}};d.baseUrl="https://api.groq.com/openai/v1";
|
|
11
11
|
|
|
12
|
-
exports.BaseChatModelGroq =
|
|
13
|
-
exports.BaseChatModelOptions =
|
|
12
|
+
exports.BaseChatModelGroq = a;
|
|
13
|
+
exports.BaseChatModelOptions = t;
|
|
14
14
|
exports.Gemma2_9b_IT = _;
|
|
15
15
|
exports.Gemma2_9b_ITLiteral = P;
|
|
16
|
-
exports.Gemma2_9b_ITOptions =
|
|
16
|
+
exports.Gemma2_9b_ITOptions = de;
|
|
17
17
|
exports.Gemma2_9b_ITSchema = U;
|
|
18
18
|
exports.Gemma_7b_IT = c;
|
|
19
19
|
exports.Gemma_7b_ITLiteral = z;
|
|
20
|
-
exports.Gemma_7b_ITOptions =
|
|
20
|
+
exports.Gemma_7b_ITOptions = pe;
|
|
21
21
|
exports.Gemma_7b_ITSchema = v;
|
|
22
22
|
exports.Groq = d;
|
|
23
|
-
exports.LlamaGuard_3_8b =
|
|
23
|
+
exports.LlamaGuard_3_8b = M;
|
|
24
24
|
exports.LlamaGuard_3_8bLiteral = F;
|
|
25
|
-
exports.LlamaGuard_3_8bOptions =
|
|
25
|
+
exports.LlamaGuard_3_8bOptions = _e;
|
|
26
26
|
exports.LlamaGuard_3_8bSchema = V;
|
|
27
27
|
exports.Llama_3_1_70b = L;
|
|
28
28
|
exports.Llama_3_1_70bLiteral = te;
|
|
29
29
|
exports.Llama_3_1_70bSchema = se;
|
|
30
|
-
exports.Llama_3_1_70b_Options =
|
|
30
|
+
exports.Llama_3_1_70b_Options = ye;
|
|
31
31
|
exports.Llama_3_1_8b = x;
|
|
32
|
-
exports.Llama_3_1_8bLiteral =
|
|
33
|
-
exports.Llama_3_1_8bSchema =
|
|
34
|
-
exports.Llama_3_1_8b_Options =
|
|
32
|
+
exports.Llama_3_1_8bLiteral = le;
|
|
33
|
+
exports.Llama_3_1_8bSchema = ne;
|
|
34
|
+
exports.Llama_3_1_8b_Options = Ce;
|
|
35
35
|
exports.Llama_3_2_11b_Vision = O;
|
|
36
36
|
exports.Llama_3_2_11b_VisionLiteral = H;
|
|
37
|
-
exports.Llama_3_2_11b_VisionOptions =
|
|
37
|
+
exports.Llama_3_2_11b_VisionOptions = Te;
|
|
38
38
|
exports.Llama_3_2_11b_VisionSchema = J;
|
|
39
39
|
exports.Llama_3_2_1b = C;
|
|
40
40
|
exports.Llama_3_2_1bLiteral = oe;
|
|
41
41
|
exports.Llama_3_2_1bSchema = ae;
|
|
42
|
-
exports.Llama_3_2_1b_Options =
|
|
42
|
+
exports.Llama_3_2_1b_Options = Oe;
|
|
43
43
|
exports.Llama_3_2_3b = y;
|
|
44
44
|
exports.Llama_3_2_3bLiteral = W;
|
|
45
45
|
exports.Llama_3_2_3bSchema = ee;
|
|
46
|
-
exports.Llama_3_2_3b_Options =
|
|
47
|
-
exports.Llama_3_70b =
|
|
46
|
+
exports.Llama_3_2_3b_Options = ue;
|
|
47
|
+
exports.Llama_3_70b = b;
|
|
48
48
|
exports.Llama_3_70bLiteral = K;
|
|
49
|
-
exports.Llama_3_70bOptions =
|
|
49
|
+
exports.Llama_3_70bOptions = Me;
|
|
50
50
|
exports.Llama_3_70bSchema = Y;
|
|
51
|
-
exports.Llama_3_70b_Tool_Use =
|
|
51
|
+
exports.Llama_3_70b_Tool_Use = T;
|
|
52
52
|
exports.Llama_3_70b_Tool_UseLiteral = $;
|
|
53
53
|
exports.Llama_3_70b_Tool_UseSchema = Q;
|
|
54
|
-
exports.Llama_3_70b_Tool_Use_Options =
|
|
55
|
-
exports.Llama_3_8b =
|
|
54
|
+
exports.Llama_3_70b_Tool_Use_Options = fe;
|
|
55
|
+
exports.Llama_3_8b = f;
|
|
56
56
|
exports.Llama_3_8bLiteral = D;
|
|
57
|
-
exports.Llama_3_8bOptions =
|
|
57
|
+
exports.Llama_3_8bOptions = he;
|
|
58
58
|
exports.Llama_3_8bSchema = j;
|
|
59
|
-
exports.Llama_3_8b_Tool_Use =
|
|
59
|
+
exports.Llama_3_8b_Tool_Use = u;
|
|
60
60
|
exports.Llama_3_8b_Tool_UseLiteral = X;
|
|
61
61
|
exports.Llama_3_8b_Tool_UseSchema = Z;
|
|
62
|
-
exports.Llama_3_8b_Tool_Use_Options =
|
|
62
|
+
exports.Llama_3_8b_Tool_Use_Options = be;
|
|
63
63
|
exports.Mixtral_8x7b = h;
|
|
64
64
|
exports.Mixtral_8x7bLiteral = N;
|
|
65
|
-
exports.Mixtral_8x7bOptions =
|
|
65
|
+
exports.Mixtral_8x7bOptions = ce;
|
|
66
66
|
exports.Mixtral_8x7bSchema = w;
|
|
67
67
|
//# sourceMappingURL=index.js.map
|
|
68
68
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/models/chat-models/base-chat-model.groq.ts","../src/configs/chat-model/common.config.chat-model.groq.ts","../src/configs/chat-model/base.config.chat-model.groq.ts","../src/configs/configs.groq.ts","../src/models/chat-models/gemma-7b-it.groq.ts","../src/models/chat-models/gemma2-9b-it.groq.ts","../src/models/chat-models/mixtral-8x7b.groq.ts","../src/models/chat-models/llama-guard-3-8b.groq.ts","../src/models/chat-models/llama-3-8b.groq.ts","../src/models/chat-models/llama-3-70b.groq.ts","../src/models/chat-models/llama-3-70b-tool-use.groq.ts","../src/models/chat-models/llama-3-8b-tool-use.groq.ts","../src/models/chat-models/llama-3-2-11b-vision.groq.ts","../src/models/chat-models/llama-3-2-3b.groq.ts","../src/models/chat-models/llama-3-2-1b.groq.ts","../src/models/chat-models/llama-3-1-70b.groq.ts","../src/models/chat-models/llama-3-1-8b.groq.ts","../src/provider/provider.groq.ts"],"names":["BaseChatModelOptions","z","BaseChatModelGroq","BaseChatModel","modelSchema","options","parsedOptions","baseUrl","Groq","messages","transformedMessages","message","content","temperature","RangeConfigItem","CHAT_CONFIG","maxTokens","maxOutputTokens","stop","MultiStringConfigItem","topP","frequencyPenalty","presencePenalty","seed","responseFormat","SelectStringConfigItem","toolChoice","ChatModelBaseConfigSchema","value","ChatModelBaseConfigDef","GroqChatModelConfigs","Gemma_7b_ITLiteral","Gemma_7b_ITDescription","Gemma_7b_ITSchema","ChatModelSchema","OpenAIChatModelRoles","OpenAIChatModelTextToolModalitiesEnum","OpenAIChatModelRolesMap","OpenAIChatModelTextToolModalities","Gemma_7b_ITOptions","Gemma_7b_IT","Gemma2_9b_ITLiteral","Gemma2_9b_ITDescription","Gemma2_9b_ITSchema","Gemma2_9b_ITOptions","Gemma2_9b_IT","Mixtral_8x7bLiteral","Mixtral_8x7bDescription","Mixtral_8x7bSchema","Mixtral_8x7bOptions","Mixtral_8x7b","LlamaGuard_3_8bLiteral","LlamaGuard_3_8bDescription","LlamaGuard_3_8bSchema","LlamaGuard_3_8bOptions","LlamaGuard_3_8b","Llama_3_8bLiteral","Llama_3_8bDescription","Llama_3_8bSchema","Llama_3_8bOptions","Llama_3_8b","Llama_3_70bLiteral","Llama_3_70bDescription","Llama_3_70bSchema","Llama_3_70bOptions","Llama_3_70b","Llama_3_70b_Tool_UseLiteral","Llama_3_70b_Tool_UseDescription","Llama_3_70b_Tool_UseSchema","Llama_3_70b_Tool_Use_Options","Llama_3_70b_Tool_Use","Llama_3_8b_Tool_UseLiteral","Llama_3_8b_Tool_UseDescription","Llama_3_8b_Tool_UseSchema","Llama_3_8b_Tool_Use_Options","Llama_3_8b_Tool_Use","Llama_3_2_11b_VisionLiteral","Llama_3_2_11b_VisionDescription","Llama_3_2_11b_VisionSchema","OpenAIChatModelModalitiesEnum","OpenAIChatModelModalities","Llama_3_2_11b_VisionOptions","Llama_3_2_11b_Vision","Llama_3_2_3bLiteral","Llama_3_2_3bDescription","Llama_3_2_3bSchema","Llama_3_2_3b_Options","Llama_3_2_3b","Llama_3_2_1bLiteral","Llama_3_2_1bDescription","Llama_3_2_1bSchema","Llama_3_2_1b_Options","Llama_3_2_1b","Llama_3_1_70bLiteral","Llama_3_1_70bDescription","Llama_3_1_70bSchema","Llama_3_1_70b_Options","Llama_3_1_70b","Llama_3_1_8bLiteral","Llama_3_1_8bDescription","Llama_3_1_8bSchema","Llama_3_1_8b_Options","Llama_3_1_8b","ProviderLiteral","acc","key","modelName","ProviderError","model","modelOptions","__spreadProps","__spreadValues"],"mappings":";;;;;;+bAQMA,IAAAA,CAAAA,CAAuBC,MAAE,MAAO,CAAA,CACpC,SAAWA,CAAAA,KAAAA,CAAE,MAAO,EAAA,CAAE,GAAI,CAAA,CAAC,CAC3B,CAAA,MAAA,CAAQA,KAAE,CAAA,MAAA,EAAS,CAAA,GAAA,CAAI,CAAC,CAC1B,CAAC,CAGKC,CAAAA,CAAAA,CAAN,cAAgCC,oBAAc,CAO5C,WAAA,CAAYC,CAAkCC,CAAAA,CAAAA,CAAmC,CAC/E,IAAMC,CAAgBN,CAAAA,CAAAA,CAAqB,MAAMK,CAAO,CAAA,CAClDE,CAAUC,CAAAA,CAAAA,CAAK,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Aa,IAAA,IAAA,CAAK,oBACtB,MAAM,IAAIC,uBAAc,CACtB,IAAA,CAAM,oBAAoBD,CAAS,CAAA,UAAA,CAAA,CACnC,MAAO,IAAI,KAAA,CAAM,oBAAoBA,CAAS,CAAA;AAAA,UAC1C,EAAA,IAAA,CAAK,mBAAoB,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA,CAAE,CAC3C,CAAC,CAAA,CAGH,IAAME,CAAQ,CAAA,IAAA,CAAK,mBAAmBF,CAAS,CAAA,CAAE,MAC3CG,CAAeC,CAAAA,EAAAA,CAAAC,GAAA,EAChB1G,CAAAA,CAAAA,CAAAA,CADgB,CAEnB,SAAWqG,CAAAA,CACb,GACMpG,CAAgB,CAAA,IAAA,CAAK,mBAAmBoG,CAAS,CAAA,CAAE,aAAa,KAAMG,CAAAA,CAAY,EACxF,OAAO,IAAID,EAAMtG,CAAa,CAChC,CAEA,sBAAmC,EAAA,CACjC,OAAO,MAAA,CAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CACjD,CAEA,uBAAkE,CAChE,OAAO,OAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CAAE,CAAA,MAAA,CAC/C,CAACkG,CAAKC,CAAAA,CAAAA,IACJD,EAAIC,CAAG,CAAA,CAAI,KAAK,uBAAwBA,CAAAA,CAAG,EAAE,WACtCD,CAAAA,CAAAA,CAAAA,CAET,EACF,CACF,CAEA,cAAenG,CAAAA,CAAAA,CAA8B,CAC3C,MAAM,IAAIsG,uBAAc,CACtB,IAAA,CAAM,yCACN,KAAO,CAAA,IAAI,MAAM,wCAAwC,CAC3D,CAAC,CACH,CACF,EApJMnG,CAAAA,CAGY,OAAU,CAAA,gCAAA","file":"index.js","sourcesContent":["import { z } from \"zod\";\n\nimport { BaseChatModel, OpenAIChatRequestMessageType } from \"@adaline/openai\";\nimport { ChatModelSchemaType, ParamsType } from \"@adaline/provider\";\nimport { MessageType } from \"@adaline/types\";\n\nimport { Groq } from \"../../provider\";\n\nconst BaseChatModelOptions = z.object({\n modelName: z.string().min(1),\n apiKey: z.string().min(1),\n});\ntype BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;\n\nclass BaseChatModelGroq extends BaseChatModel {\n readonly version = \"v1\" as const;\n modelSchema: ChatModelSchemaType;\n readonly modelName: string;\n\n private readonly groqApiKey: string;\n\n constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType) {\n const parsedOptions = BaseChatModelOptions.parse(options);\n const baseUrl = Groq.baseUrl;\n super(modelSchema, {\n modelName: parsedOptions.modelName,\n apiKey: parsedOptions.apiKey,\n baseUrl: baseUrl,\n completeChatUrl: `${baseUrl}/chat/completions`,\n streamChatUrl: `${baseUrl}/chat/completions`,\n });\n this.modelSchema = modelSchema;\n this.modelName = parsedOptions.modelName;\n this.groqApiKey = parsedOptions.apiKey;\n }\n\n transformMessages(messages: MessageType[]): ParamsType {\n const transformedMessages = super.transformMessages(messages) as { messages: OpenAIChatRequestMessageType[] };\n\n // Groq expects the content to be a string for system and assistant messages\n // OpenAI transformer takes care of validating role and modality\n transformedMessages.messages.forEach((message) => {\n if (message.role === \"system\") {\n if (typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n } else if (message.role === \"assistant\") {\n if (message.content && typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n }\n });\n\n return transformedMessages;\n }\n\n // TODO: streamChat needs it's own implementation, OpenAI stream transformer is skipping some chunks\n}\n\nexport { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType };\n","import { CHAT_CONFIG, MultiStringConfigItem, RangeConfigItem, SelectStringConfigItem } from \"@adaline/provider\";\n\nconst temperature = RangeConfigItem({\n param: \"temperature\",\n title: CHAT_CONFIG.TEMPERATURE.title,\n description: CHAT_CONFIG.TEMPERATURE.description,\n min: 0,\n max: 2,\n step: 0.01,\n default: 1,\n});\n\nconst maxTokens = (maxOutputTokens: number) =>\n RangeConfigItem({\n param: \"max_tokens\",\n title: CHAT_CONFIG.MAX_TOKENS.title,\n description: CHAT_CONFIG.MAX_TOKENS.description,\n min: 0,\n max: maxOutputTokens,\n step: 1,\n default: 0,\n });\n\nconst stop = MultiStringConfigItem({\n param: \"stop\",\n title: CHAT_CONFIG.STOP(4).title,\n description: CHAT_CONFIG.STOP(4).description,\n max: 4,\n});\n\nconst topP = RangeConfigItem({\n param: \"top_p\",\n title: CHAT_CONFIG.TOP_P.title,\n description: CHAT_CONFIG.TOP_P.description,\n min: 0,\n max: 1,\n step: 0.01,\n default: 1,\n});\n\nconst frequencyPenalty = RangeConfigItem({\n param: \"frequency_penalty\",\n title: CHAT_CONFIG.FREQUENCY_PENALTY.title,\n description: CHAT_CONFIG.FREQUENCY_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst presencePenalty = RangeConfigItem({\n param: \"presence_penalty\",\n title: CHAT_CONFIG.PRESENCE_PENALTY.title,\n description: CHAT_CONFIG.PRESENCE_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst seed = RangeConfigItem({\n param: \"seed\",\n title: CHAT_CONFIG.SEED.title,\n description: CHAT_CONFIG.SEED.description,\n min: 0,\n max: 1000000,\n step: 1,\n default: 0,\n});\n\nconst responseFormat = SelectStringConfigItem({\n param: \"response_format\",\n title: CHAT_CONFIG.RESPONSE_FORMAT.title,\n description: CHAT_CONFIG.RESPONSE_FORMAT.description,\n default: \"text\",\n choices: [\"text\", \"json_object\"],\n});\n\nconst toolChoice = SelectStringConfigItem({\n param: \"tool_choice\",\n title: \"Tool choice\",\n description:\n \"Controls which (if any) tool is called by the model. \\\n 'none' means the model will not call a function. \\\n 'auto' means the model can pick between generating a message or calling a tool.\",\n default: \"auto\",\n choices: [\"auto\", \"required\", \"none\"],\n});\n\nexport { frequencyPenalty, maxTokens, presencePenalty, seed, stop, temperature, toolChoice, topP, responseFormat };\n","import { z } from \"zod\";\n\nimport {\n frequencyPenalty,\n maxTokens,\n presencePenalty,\n responseFormat,\n seed,\n stop,\n temperature,\n toolChoice,\n topP,\n} from \"./common.config.chat-model.groq\";\n\nconst ChatModelBaseConfigSchema = (maxOutputTokens: number) =>\n z.object({\n temperature: temperature.schema,\n maxTokens: maxTokens(maxOutputTokens).schema,\n stop: stop.schema,\n topP: topP.schema,\n frequencyPenalty: frequencyPenalty.schema,\n presencePenalty: presencePenalty.schema,\n seed: seed.schema.transform((value) => (value === 0 ? undefined : value)),\n responseFormat: responseFormat.schema,\n toolChoice: toolChoice.schema,\n });\n\nconst ChatModelBaseConfigDef = (maxOutputTokens: number) =>\n ({\n temperature: temperature.def,\n maxTokens: maxTokens(maxOutputTokens).def,\n stop: stop.def,\n topP: topP.def,\n frequencyPenalty: frequencyPenalty.def,\n presencePenalty: presencePenalty.def,\n seed: seed.def,\n responseFormat: responseFormat.def,\n toolChoice: toolChoice.def,\n }) as const;\n\nexport { ChatModelBaseConfigDef, ChatModelBaseConfigSchema };\n","import { ChatModelBaseConfigDef, ChatModelBaseConfigSchema } from \"./chat-model\";\n\nconst GroqChatModelConfigs = {\n base: (maxOutputTokens: number) => ({\n def: ChatModelBaseConfigDef(maxOutputTokens),\n schema: ChatModelBaseConfigSchema(maxOutputTokens),\n }),\n} as const;\n\nexport { GroqChatModelConfigs };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma_7b_ITLiteral = \"gemma-7b-it\" as const;\n// https://huggingface.co/google/gemma-1.1-7b-it\nconst Gemma_7b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma_7b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma_7b_ITLiteral,\n description: Gemma_7b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma_7b_ITOptions = BaseChatModelOptions;\ntype Gemma_7b_ITOptionsType = z.infer<typeof Gemma_7b_ITOptions>;\n\nclass Gemma_7b_IT extends BaseChatModelGroq {\n constructor(options: Gemma_7b_ITOptionsType) {\n super(Gemma_7b_ITSchema, options);\n }\n}\n\nexport { Gemma_7b_IT, Gemma_7b_ITOptions, Gemma_7b_ITSchema, Gemma_7b_ITLiteral, type Gemma_7b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma2_9b_ITLiteral = \"gemma2-9b-it\" as const;\n// https://huggingface.co/google/gemma-2-9b-it\nconst Gemma2_9b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma2_9b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma2_9b_ITLiteral,\n description: Gemma2_9b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma2_9b_ITOptions = BaseChatModelOptions;\ntype Gemma2_9b_ITOptionsType = z.infer<typeof Gemma2_9b_ITOptions>;\n\nclass Gemma2_9b_IT extends BaseChatModelGroq {\n constructor(options: Gemma2_9b_ITOptionsType) {\n super(Gemma2_9b_ITSchema, options);\n }\n}\n\nexport { Gemma2_9b_IT, Gemma2_9b_ITOptions, Gemma2_9b_ITSchema, Gemma2_9b_ITLiteral, type Gemma2_9b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Mixtral_8x7bLiteral = \"mixtral-8x7b-32768\" as const;\n// https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1\nconst Mixtral_8x7bDescription = \"The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts.\";\n\nconst Mixtral_8x7bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Mixtral_8x7bLiteral,\n description: Mixtral_8x7bDescription,\n maxInputTokens: 32768,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Mixtral_8x7bOptions = BaseChatModelOptions;\ntype Mixtral_8x7bOptionsType = z.infer<typeof Mixtral_8x7bOptions>;\n\nclass Mixtral_8x7b extends BaseChatModelGroq {\n constructor(options: Mixtral_8x7bOptionsType) {\n super(Mixtral_8x7bSchema, options);\n }\n}\n\nexport { Mixtral_8x7b, Mixtral_8x7bOptions, Mixtral_8x7bSchema, Mixtral_8x7bLiteral, type Mixtral_8x7bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst LlamaGuard_3_8bLiteral = \"llama-guard-3-8b\" as const;\n// https://huggingface.co/meta-llama/Llama-Guard-3-8B\nconst LlamaGuard_3_8bDescription = \"Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.\";\n\nconst LlamaGuard_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: LlamaGuard_3_8bLiteral,\n description: LlamaGuard_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst LlamaGuard_3_8bOptions = BaseChatModelOptions;\ntype LlamaGuard_3_8bOptionsType = z.infer<typeof LlamaGuard_3_8bOptions>;\n\nclass LlamaGuard_3_8b extends BaseChatModelGroq {\n constructor(options: LlamaGuard_3_8bOptionsType) {\n super(LlamaGuard_3_8bSchema, options);\n }\n}\n\nexport { LlamaGuard_3_8b, LlamaGuard_3_8bOptions, LlamaGuard_3_8bSchema, LlamaGuard_3_8bLiteral, type LlamaGuard_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8bLiteral = \"llama3-8b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct\nconst Llama_3_8bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8bLiteral,\n description: Llama_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8bOptions = BaseChatModelOptions;\ntype Llama_3_8bOptionsType = z.infer<typeof Llama_3_8bOptions>;\n\nclass Llama_3_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_8bOptionsType) {\n super(Llama_3_8bSchema, options);\n }\n}\n\nexport { Llama_3_8b, Llama_3_8bOptions, Llama_3_8bSchema, Llama_3_8bLiteral, type Llama_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70bLiteral = \"llama3-70b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct\nconst Llama_3_70bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70bLiteral,\n description: Llama_3_70bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70bOptions = BaseChatModelOptions;\ntype Llama_3_70bOptionsType = z.infer<typeof Llama_3_70bOptions>;\n\nclass Llama_3_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_70bOptionsType) {\n super(Llama_3_70bSchema, options);\n }\n}\n\nexport { Llama_3_70b, Llama_3_70bOptions, Llama_3_70bSchema, Llama_3_70bLiteral, type Llama_3_70bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70b_Tool_UseLiteral = \"llama3-groq-70b-8192-tool-use-preview\" as const;\n// https://huggingface.co/Groq/Llama-3-Groq-70B-Tool-Use\nconst Llama_3_70b_Tool_UseDescription =\n \"This is the 70B parameter version of the Llama 3 Groq Tool Use model, \\\n specifically designed for advanced tool use and function calling tasks.\";\n\nconst Llama_3_70b_Tool_UseSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70b_Tool_UseLiteral,\n description: Llama_3_70b_Tool_UseDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70b_Tool_Use_Options = BaseChatModelOptions;\ntype Llama_3_70b_Tool_Use_OptionsType = z.infer<typeof Llama_3_70b_Tool_Use_Options>;\n\nclass Llama_3_70b_Tool_Use extends BaseChatModelGroq {\n constructor(options: Llama_3_70b_Tool_Use_OptionsType) {\n super(Llama_3_70b_Tool_UseSchema, options);\n }\n}\n\nexport {\n Llama_3_70b_Tool_Use,\n Llama_3_70b_Tool_Use_Options,\n Llama_3_70b_Tool_UseSchema,\n Llama_3_70b_Tool_UseLiteral,\n type Llama_3_70b_Tool_Use_OptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8b_Tool_UseLiteral = \"llama3-groq-8b-8192-tool-use-preview\" as const;\n// https://huggingface.co/Groq/Llama-3-Groq-8B-Tool-Use\nconst Llama_3_8b_Tool_UseDescription =\n \"This is the 8B parameter version of the Llama 3 Groq Tool Use model, \\\n specifically designed for advanced tool use and function calling tasks.\";\n\nconst Llama_3_8b_Tool_UseSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8b_Tool_UseLiteral,\n description: Llama_3_8b_Tool_UseDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8b_Tool_Use_Options = BaseChatModelOptions;\ntype Llama_3_8b_Tool_Use_OptionsType = z.infer<typeof Llama_3_8b_Tool_Use_Options>;\n\nclass Llama_3_8b_Tool_Use extends BaseChatModelGroq {\n constructor(options: Llama_3_8b_Tool_Use_OptionsType) {\n super(Llama_3_8b_Tool_UseSchema, options);\n }\n}\n\nexport {\n Llama_3_8b_Tool_Use,\n Llama_3_8b_Tool_Use_Options,\n Llama_3_8b_Tool_UseSchema,\n Llama_3_8b_Tool_UseLiteral,\n type Llama_3_8b_Tool_Use_OptionsType,\n};\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_11b_VisionLiteral = \"llama-3.2-11b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-11B-Vision\nconst Llama_3_2_11b_VisionDescription =\n \"The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, \\\n and answering general questions about an image. \\\n The models outperform many of the available open source and closed multimodal models on common industry benchmarks.\";\n\nconst Llama_3_2_11b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_11b_VisionLiteral,\n description: Llama_3_2_11b_VisionDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_11b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_11b_VisionOptionsType = z.infer<typeof Llama_3_2_11b_VisionOptions>;\n\nclass Llama_3_2_11b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_11b_VisionOptionsType) {\n super(Llama_3_2_11b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n Llama_3_2_11b_VisionLiteral,\n type Llama_3_2_11b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_3bLiteral = \"llama-3.2-3b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-3B\nconst Llama_3_2_3bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_3bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_3bLiteral,\n description: Llama_3_2_3bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_3b_Options = BaseChatModelOptions;\ntype Llama_3_2_3b_OptionsType = z.infer<typeof Llama_3_2_3b_Options>;\n\nclass Llama_3_2_3b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_3b_OptionsType) {\n super(Llama_3_2_3bSchema, options);\n }\n}\n\nexport { Llama_3_2_3b, Llama_3_2_3b_Options, Llama_3_2_3bSchema, Llama_3_2_3bLiteral, type Llama_3_2_3b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_1bLiteral = \"llama-3.2-1b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-1B\nconst Llama_3_2_1bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_1bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_1bLiteral,\n description: Llama_3_2_1bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_1b_Options = BaseChatModelOptions;\ntype Llama_3_2_1b_OptionsType = z.infer<typeof Llama_3_2_1b_Options>;\n\nclass Llama_3_2_1b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_1b_OptionsType) {\n super(Llama_3_2_1bSchema, options);\n }\n}\n\nexport { Llama_3_2_1b, Llama_3_2_1b_Options, Llama_3_2_1bSchema, Llama_3_2_1bLiteral, type Llama_3_2_1b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_70bLiteral = \"llama-3.1-70b-versatile\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_70bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_70bLiteral,\n description: Llama_3_1_70bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_70b_Options = BaseChatModelOptions;\ntype Llama_3_1_70b_OptionsType = z.infer<typeof Llama_3_1_70b_Options>;\n\nclass Llama_3_1_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_70b_OptionsType) {\n super(Llama_3_1_70bSchema, options);\n }\n}\n\nexport { Llama_3_1_70b, Llama_3_1_70b_Options, Llama_3_1_70bSchema, Llama_3_1_70bLiteral, type Llama_3_1_70b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_8bLiteral = \"llama-3.1-8b-instant\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_8bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_8bLiteral,\n description: Llama_3_1_8bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_8b_Options = BaseChatModelOptions;\ntype Llama_3_1_8b_OptionsType = z.infer<typeof Llama_3_1_8b_Options>;\n\nclass Llama_3_1_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_8b_OptionsType) {\n super(Llama_3_1_8bSchema, options);\n }\n}\n\nexport { Llama_3_1_8b, Llama_3_1_8b_Options, Llama_3_1_8bSchema, Llama_3_1_8bLiteral, type Llama_3_1_8b_OptionsType };\n","import { z } from \"zod\";\n\nimport { ChatModelSchemaType, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderError, ProviderV1 } from \"@adaline/provider\";\n\nimport {\n Gemma_7b_IT,\n Gemma_7b_ITLiteral,\n Gemma_7b_ITOptions,\n Gemma_7b_ITSchema,\n Gemma2_9b_IT,\n Gemma2_9b_ITLiteral,\n Gemma2_9b_ITOptions,\n Gemma2_9b_ITSchema,\n Llama_3_1_8b,\n Llama_3_1_8b_Options,\n Llama_3_1_8bLiteral,\n Llama_3_1_8bSchema,\n Llama_3_1_70b,\n Llama_3_1_70b_Options,\n Llama_3_1_70bLiteral,\n Llama_3_1_70bSchema,\n Llama_3_2_1b,\n Llama_3_2_1b_Options,\n Llama_3_2_1bLiteral,\n Llama_3_2_1bSchema,\n Llama_3_2_3b,\n Llama_3_2_3b_Options,\n Llama_3_2_3bLiteral,\n Llama_3_2_3bSchema,\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionLiteral,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n Llama_3_8b,\n Llama_3_8b_Tool_Use,\n Llama_3_8b_Tool_Use_Options,\n Llama_3_8b_Tool_UseLiteral,\n Llama_3_8b_Tool_UseSchema,\n Llama_3_8bLiteral,\n Llama_3_8bOptions,\n Llama_3_8bSchema,\n Llama_3_70b,\n Llama_3_70b_Tool_Use,\n Llama_3_70b_Tool_Use_Options,\n Llama_3_70b_Tool_UseLiteral,\n Llama_3_70b_Tool_UseSchema,\n Llama_3_70bLiteral,\n Llama_3_70bOptions,\n Llama_3_70bSchema,\n LlamaGuard_3_8b,\n LlamaGuard_3_8bLiteral,\n LlamaGuard_3_8bOptions,\n LlamaGuard_3_8bSchema,\n Mixtral_8x7b,\n Mixtral_8x7bLiteral,\n Mixtral_8x7bOptions,\n Mixtral_8x7bSchema,\n} from \"./../models\";\n\nconst ProviderLiteral = \"groq\";\nclass Groq<O extends Record<string, any> = Record<string, any>> implements ProviderV1<O> {\n readonly version = \"v1\" as const;\n readonly name = ProviderLiteral;\n static readonly baseUrl = \"https://api.groq.com/openai/v1\";\n\n private readonly chatModelFactories: Record<\n string,\n {\n model: { new (options: any): ChatModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: ChatModelSchemaType;\n }\n > = {\n [Gemma_7b_ITLiteral]: {\n model: Gemma_7b_IT,\n modelOptions: Gemma_7b_ITOptions,\n modelSchema: Gemma_7b_ITSchema,\n },\n [Gemma2_9b_ITLiteral]: {\n model: Gemma2_9b_IT,\n modelOptions: Gemma2_9b_ITOptions,\n modelSchema: Gemma2_9b_ITSchema,\n },\n [LlamaGuard_3_8bLiteral]: {\n model: LlamaGuard_3_8b,\n modelOptions: LlamaGuard_3_8bOptions,\n modelSchema: LlamaGuard_3_8bSchema,\n },\n [Llama_3_8bLiteral]: {\n model: Llama_3_8b,\n modelOptions: Llama_3_8bOptions,\n modelSchema: Llama_3_8bSchema,\n },\n [Llama_3_70bLiteral]: {\n model: Llama_3_70b,\n modelOptions: Llama_3_70bOptions,\n modelSchema: Llama_3_70bSchema,\n },\n [Llama_3_1_8bLiteral]: {\n model: Llama_3_1_8b,\n modelOptions: Llama_3_1_8b_Options,\n modelSchema: Llama_3_1_8bSchema,\n },\n [Llama_3_8b_Tool_UseLiteral]: {\n model: Llama_3_8b_Tool_Use,\n modelOptions: Llama_3_8b_Tool_Use_Options,\n modelSchema: Llama_3_8b_Tool_UseSchema,\n },\n [Llama_3_1_70bLiteral]: {\n model: Llama_3_1_70b,\n modelOptions: Llama_3_1_70b_Options,\n modelSchema: Llama_3_1_70bSchema,\n },\n [Llama_3_70b_Tool_UseLiteral]: {\n model: Llama_3_70b_Tool_Use,\n modelOptions: Llama_3_70b_Tool_Use_Options,\n modelSchema: Llama_3_70b_Tool_UseSchema,\n },\n [Llama_3_2_11b_VisionLiteral]: {\n model: Llama_3_2_11b_Vision,\n modelOptions: Llama_3_2_11b_VisionOptions,\n modelSchema: Llama_3_2_11b_VisionSchema,\n },\n [Llama_3_2_3bLiteral]: {\n model: Llama_3_2_3b,\n modelOptions: Llama_3_2_3b_Options,\n modelSchema: Llama_3_2_3bSchema,\n },\n [Llama_3_2_1bLiteral]: {\n model: Llama_3_2_1b,\n modelOptions: Llama_3_2_1b_Options,\n modelSchema: Llama_3_2_1bSchema,\n },\n [Mixtral_8x7bLiteral]: {\n model: Mixtral_8x7b,\n modelOptions: Mixtral_8x7bOptions,\n modelSchema: Mixtral_8x7bSchema,\n },\n };\n\n private readonly embeddingModelFactories: Record<\n string,\n {\n model: { new (options: any): EmbeddingModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: EmbeddingModelSchemaType;\n }\n > = {};\n\n chatModelLiterals(): string[] {\n return Object.keys(this.chatModelFactories);\n }\n\n chatModelSchemas(): Record<string, ChatModelSchemaType> {\n return Object.keys(this.chatModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.chatModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, ChatModelSchemaType>\n );\n }\n\n chatModel(options: O): ChatModelV1 {\n const modelName = options.modelName;\n if (!modelName) {\n throw new ProviderError({\n info: \"options.modelName is required\",\n cause: new Error(\"options.modelName is required\"),\n });\n }\n if (!(modelName in this.chatModelFactories)) {\n throw new ProviderError({\n info: `Groq chat model: ${modelName} not found`,\n cause: new Error(`Groq chat model: ${modelName} not found, available chat models: \n ${this.chatModelLiterals().join(\", \")}`),\n });\n }\n\n const model = this.chatModelFactories[modelName].model;\n const modelOptions = {\n ...options,\n modelName: modelName,\n };\n const parsedOptions = this.chatModelFactories[modelName].modelOptions.parse(modelOptions);\n return new model(parsedOptions);\n }\n\n embeddingModelLiterals(): string[] {\n return Object.keys(this.embeddingModelFactories);\n }\n\n embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType> {\n return Object.keys(this.embeddingModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.embeddingModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, EmbeddingModelSchemaType>\n );\n }\n\n embeddingModel(options: O): EmbeddingModelV1 {\n throw new ProviderError({\n info: \"Groq does not support embedding models\",\n cause: new Error(\"Groq does not support embedding models\"),\n });\n }\n}\n\nexport { Groq };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/models/chat-models/base-chat-model.groq.ts","../src/configs/chat-model/common.config.chat-model.groq.ts","../src/configs/chat-model/base.config.chat-model.groq.ts","../src/configs/configs.groq.ts","../src/models/chat-models/gemma-7b-it.groq.ts","../src/models/chat-models/gemma2-9b-it.groq.ts","../src/models/chat-models/mixtral-8x7b.groq.ts","../src/models/chat-models/llama-guard-3-8b.groq.ts","../src/models/chat-models/llama-3-8b.groq.ts","../src/models/chat-models/llama-3-70b.groq.ts","../src/models/chat-models/llama-3-70b-tool-use.groq.ts","../src/models/chat-models/llama-3-8b-tool-use.groq.ts","../src/models/chat-models/llama-3-2-11b-vision.groq.ts","../src/models/chat-models/llama-3-2-3b.groq.ts","../src/models/chat-models/llama-3-2-1b.groq.ts","../src/models/chat-models/llama-3-1-70b.groq.ts","../src/models/chat-models/llama-3-1-8b.groq.ts","../src/provider/provider.groq.ts"],"names":["BaseChatModelOptions","z","BaseChatModelGroq","BaseChatModel","modelSchema","options","parsedOptions","baseUrl","Groq","messages","transformedMessages","message","content","temperature","RangeConfigItem","CHAT_CONFIG","maxTokens","maxOutputTokens","stop","MultiStringConfigItem","topP","frequencyPenalty","presencePenalty","seed","responseFormat","SelectStringConfigItem","toolChoice","ChatModelBaseConfigSchema","value","ChatModelBaseConfigDef","GroqChatModelConfigs","Gemma_7b_ITLiteral","Gemma_7b_ITDescription","Gemma_7b_ITSchema","ChatModelSchema","OpenAIChatModelRoles","OpenAIChatModelTextToolModalitiesEnum","OpenAIChatModelRolesMap","OpenAIChatModelTextToolModalities","Gemma_7b_ITOptions","Gemma_7b_IT","Gemma2_9b_ITLiteral","Gemma2_9b_ITDescription","Gemma2_9b_ITSchema","Gemma2_9b_ITOptions","Gemma2_9b_IT","Mixtral_8x7bLiteral","Mixtral_8x7bDescription","Mixtral_8x7bSchema","Mixtral_8x7bOptions","Mixtral_8x7b","LlamaGuard_3_8bLiteral","LlamaGuard_3_8bDescription","LlamaGuard_3_8bSchema","LlamaGuard_3_8bOptions","LlamaGuard_3_8b","Llama_3_8bLiteral","Llama_3_8bDescription","Llama_3_8bSchema","Llama_3_8bOptions","Llama_3_8b","Llama_3_70bLiteral","Llama_3_70bDescription","Llama_3_70bSchema","Llama_3_70bOptions","Llama_3_70b","Llama_3_70b_Tool_UseLiteral","Llama_3_70b_Tool_UseDescription","Llama_3_70b_Tool_UseSchema","Llama_3_70b_Tool_Use_Options","Llama_3_70b_Tool_Use","Llama_3_8b_Tool_UseLiteral","Llama_3_8b_Tool_UseDescription","Llama_3_8b_Tool_UseSchema","Llama_3_8b_Tool_Use_Options","Llama_3_8b_Tool_Use","Llama_3_2_11b_VisionLiteral","Llama_3_2_11b_VisionDescription","Llama_3_2_11b_VisionSchema","OpenAIChatModelModalitiesEnum","OpenAIChatModelModalities","Llama_3_2_11b_VisionOptions","Llama_3_2_11b_Vision","Llama_3_2_3bLiteral","Llama_3_2_3bDescription","Llama_3_2_3bSchema","Llama_3_2_3b_Options","Llama_3_2_3b","Llama_3_2_1bLiteral","Llama_3_2_1bDescription","Llama_3_2_1bSchema","Llama_3_2_1b_Options","Llama_3_2_1b","Llama_3_1_70bLiteral","Llama_3_1_70bDescription","Llama_3_1_70bSchema","Llama_3_1_70b_Options","Llama_3_1_70b","Llama_3_1_8bLiteral","Llama_3_1_8bDescription","Llama_3_1_8bSchema","Llama_3_1_8b_Options","Llama_3_1_8b","ProviderLiteral","acc","key","modelName","ProviderError","model"],"mappings":";;;;;;AAQMA,IAAAA,CAAAA,CAAuBC,MAAE,MAAO,CAAA,CACpC,SAAWA,CAAAA,KAAAA,CAAE,MAAO,EAAA,CAAE,GAAI,CAAA,CAAC,CAC3B,CAAA,MAAA,CAAQA,KAAE,CAAA,MAAA,EAAS,CAAA,GAAA,CAAI,CAAC,CAC1B,CAAC,CAGKC,CAAAA,CAAAA,CAAN,cAAgCC,oBAAc,CAO5C,WAAA,CAAYC,CAAkCC,CAAAA,CAAAA,CAAmC,CAC/E,IAAMC,CAAgBN,CAAAA,CAAAA,CAAqB,MAAMK,CAAO,CAAA,CAClDE,CAAUC,CAAAA,CAAAA,CAAK,OACrB,CAAA,KAAA,CAAMJ,CAAa,CAAA,CACjB,SAAWE,CAAAA,CAAAA,CAAc,SACzB,CAAA,MAAA,CAAQA,CAAc,CAAA,MAAA,CACtB,QAASC,CACT,CAAA,eAAA,CAAiB,CAAGA,EAAAA,CAAO,CAC3B,iBAAA,CAAA,CAAA,aAAA,CAAe,CAAGA,EAAAA,CAAO,CAC3B,iBAAA,CAAA,CAAC,CAfH,CAAA,IAAA,CAAS,OAAU,CAAA,IAAA,CAgBjB,KAAK,WAAcH,CAAAA,CAAAA,CACnB,IAAK,CAAA,SAAA,CAAYE,CAAc,CAAA,SAAA,CAC/B,IAAK,CAAA,UAAA,CAAaA,CAAc,CAAA,OAClC,CAEA,iBAAA,CAAkBG,CAAqC,CAAA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AAa,KAAMrG,CAAAA,CAAO,EACnF,OAAO,IAAIuG,EAAMtG,CAAa,CAChC,CAEA,sBAAA,EAAmC,CACjC,OAAO,MAAA,CAAO,KAAK,IAAK,CAAA,uBAAuB,CACjD,CAEA,qBAAA,EAAkE,CAChE,OAAO,OAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CAAE,CAAA,MAAA,CAC/C,CAACkG,CAAKC,CAAAA,CAAAA,IACJD,CAAIC,CAAAA,CAAG,EAAI,IAAK,CAAA,uBAAA,CAAwBA,CAAG,CAAE,CAAA,WAAA,CACtCD,GAET,EACF,CACF,CAGA,eAAenG,CAA8B,CAAA,CAC3C,MAAM,IAAIsG,sBAAAA,CAAc,CACtB,IAAM,CAAA,4CAAA,CACN,MAAO,IAAI,KAAA,CAAM,4CAA4C,CAC/D,CAAC,CACH,CACF,EA3IMnG,EAGY,OAAU,CAAA,gCAAA","file":"index.js","sourcesContent":["import { z } from \"zod\";\n\nimport { BaseChatModel, OpenAIChatRequestMessageType } from \"@adaline/openai\";\nimport { ChatModelSchemaType, ParamsType } from \"@adaline/provider\";\nimport { MessageType } from \"@adaline/types\";\n\nimport { Groq } from \"../../provider\";\n\nconst BaseChatModelOptions = z.object({\n modelName: z.string().min(1),\n apiKey: z.string().min(1),\n});\ntype BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;\n\nclass BaseChatModelGroq extends BaseChatModel {\n readonly version = \"v1\" as const;\n modelSchema: ChatModelSchemaType;\n readonly modelName: string;\n\n private readonly groqApiKey: string;\n\n constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType) {\n const parsedOptions = BaseChatModelOptions.parse(options);\n const baseUrl = Groq.baseUrl;\n super(modelSchema, {\n modelName: parsedOptions.modelName,\n apiKey: parsedOptions.apiKey,\n baseUrl: baseUrl,\n completeChatUrl: `${baseUrl}/chat/completions`,\n streamChatUrl: `${baseUrl}/chat/completions`,\n });\n this.modelSchema = modelSchema;\n this.modelName = parsedOptions.modelName;\n this.groqApiKey = parsedOptions.apiKey;\n }\n\n transformMessages(messages: MessageType[]): ParamsType {\n const transformedMessages = super.transformMessages(messages) as { messages: OpenAIChatRequestMessageType[] };\n\n // Groq expects the content to be a string for system and assistant messages\n // OpenAI transformer takes care of validating role and modality\n transformedMessages.messages.forEach((message) => {\n if (message.role === \"system\") {\n if (typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n } else if (message.role === \"assistant\") {\n if (message.content && typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n }\n });\n\n return transformedMessages;\n }\n\n // TODO: streamChat needs it's own implementation, OpenAI stream transformer is skipping some chunks\n}\n\nexport { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType };\n","import { CHAT_CONFIG, MultiStringConfigItem, RangeConfigItem, SelectStringConfigItem } from \"@adaline/provider\";\n\nconst temperature = RangeConfigItem({\n param: \"temperature\",\n title: CHAT_CONFIG.TEMPERATURE.title,\n description: CHAT_CONFIG.TEMPERATURE.description,\n min: 0,\n max: 2,\n step: 0.01,\n default: 1,\n});\n\nconst maxTokens = (maxOutputTokens: number) =>\n RangeConfigItem({\n param: \"max_tokens\",\n title: CHAT_CONFIG.MAX_TOKENS.title,\n description: CHAT_CONFIG.MAX_TOKENS.description,\n min: 0,\n max: maxOutputTokens,\n step: 1,\n default: 0,\n });\n\nconst stop = MultiStringConfigItem({\n param: \"stop\",\n title: CHAT_CONFIG.STOP(4).title,\n description: CHAT_CONFIG.STOP(4).description,\n max: 4,\n});\n\nconst topP = RangeConfigItem({\n param: \"top_p\",\n title: CHAT_CONFIG.TOP_P.title,\n description: CHAT_CONFIG.TOP_P.description,\n min: 0,\n max: 1,\n step: 0.01,\n default: 1,\n});\n\nconst frequencyPenalty = RangeConfigItem({\n param: \"frequency_penalty\",\n title: CHAT_CONFIG.FREQUENCY_PENALTY.title,\n description: CHAT_CONFIG.FREQUENCY_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst presencePenalty = RangeConfigItem({\n param: \"presence_penalty\",\n title: CHAT_CONFIG.PRESENCE_PENALTY.title,\n description: CHAT_CONFIG.PRESENCE_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst seed = RangeConfigItem({\n param: \"seed\",\n title: CHAT_CONFIG.SEED.title,\n description: CHAT_CONFIG.SEED.description,\n min: 0,\n max: 1000000,\n step: 1,\n default: 0,\n});\n\nconst responseFormat = SelectStringConfigItem({\n param: \"response_format\",\n title: CHAT_CONFIG.RESPONSE_FORMAT.title,\n description: CHAT_CONFIG.RESPONSE_FORMAT.description,\n default: \"text\",\n choices: [\"text\", \"json_object\"],\n});\n\nconst toolChoice = SelectStringConfigItem({\n param: \"tool_choice\",\n title: \"Tool choice\",\n description:\n \"Controls which (if any) tool is called by the model. \\\n 'none' means the model will not call a function. \\\n 'auto' means the model can pick between generating a message or calling a tool.\",\n default: \"auto\",\n choices: [\"auto\", \"required\", \"none\"],\n});\n\nexport { frequencyPenalty, maxTokens, presencePenalty, seed, stop, temperature, toolChoice, topP, responseFormat };\n","import { z } from \"zod\";\n\nimport {\n frequencyPenalty,\n maxTokens,\n presencePenalty,\n responseFormat,\n seed,\n stop,\n temperature,\n toolChoice,\n topP,\n} from \"./common.config.chat-model.groq\";\n\nconst ChatModelBaseConfigSchema = (maxOutputTokens: number) =>\n z.object({\n temperature: temperature.schema,\n maxTokens: maxTokens(maxOutputTokens).schema,\n stop: stop.schema,\n topP: topP.schema,\n frequencyPenalty: frequencyPenalty.schema,\n presencePenalty: presencePenalty.schema,\n seed: seed.schema.transform((value) => (value === 0 ? undefined : value)),\n responseFormat: responseFormat.schema,\n toolChoice: toolChoice.schema,\n });\n\nconst ChatModelBaseConfigDef = (maxOutputTokens: number) =>\n ({\n temperature: temperature.def,\n maxTokens: maxTokens(maxOutputTokens).def,\n stop: stop.def,\n topP: topP.def,\n frequencyPenalty: frequencyPenalty.def,\n presencePenalty: presencePenalty.def,\n seed: seed.def,\n responseFormat: responseFormat.def,\n toolChoice: toolChoice.def,\n }) as const;\n\nexport { ChatModelBaseConfigDef, ChatModelBaseConfigSchema };\n","import { ChatModelBaseConfigDef, ChatModelBaseConfigSchema } from \"./chat-model\";\n\nconst GroqChatModelConfigs = {\n base: (maxOutputTokens: number) => ({\n def: ChatModelBaseConfigDef(maxOutputTokens),\n schema: ChatModelBaseConfigSchema(maxOutputTokens),\n }),\n} as const;\n\nexport { GroqChatModelConfigs };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma_7b_ITLiteral = \"gemma-7b-it\" as const;\n// https://huggingface.co/google/gemma-1.1-7b-it\nconst Gemma_7b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma_7b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma_7b_ITLiteral,\n description: Gemma_7b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma_7b_ITOptions = BaseChatModelOptions;\ntype Gemma_7b_ITOptionsType = z.infer<typeof Gemma_7b_ITOptions>;\n\nclass Gemma_7b_IT extends BaseChatModelGroq {\n constructor(options: Gemma_7b_ITOptionsType) {\n super(Gemma_7b_ITSchema, options);\n }\n}\n\nexport { Gemma_7b_IT, Gemma_7b_ITOptions, Gemma_7b_ITSchema, Gemma_7b_ITLiteral, type Gemma_7b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma2_9b_ITLiteral = \"gemma2-9b-it\" as const;\n// https://huggingface.co/google/gemma-2-9b-it\nconst Gemma2_9b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma2_9b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma2_9b_ITLiteral,\n description: Gemma2_9b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma2_9b_ITOptions = BaseChatModelOptions;\ntype Gemma2_9b_ITOptionsType = z.infer<typeof Gemma2_9b_ITOptions>;\n\nclass Gemma2_9b_IT extends BaseChatModelGroq {\n constructor(options: Gemma2_9b_ITOptionsType) {\n super(Gemma2_9b_ITSchema, options);\n }\n}\n\nexport { Gemma2_9b_IT, Gemma2_9b_ITOptions, Gemma2_9b_ITSchema, Gemma2_9b_ITLiteral, type Gemma2_9b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Mixtral_8x7bLiteral = \"mixtral-8x7b-32768\" as const;\n// https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1\nconst Mixtral_8x7bDescription = \"The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts.\";\n\nconst Mixtral_8x7bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Mixtral_8x7bLiteral,\n description: Mixtral_8x7bDescription,\n maxInputTokens: 32768,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Mixtral_8x7bOptions = BaseChatModelOptions;\ntype Mixtral_8x7bOptionsType = z.infer<typeof Mixtral_8x7bOptions>;\n\nclass Mixtral_8x7b extends BaseChatModelGroq {\n constructor(options: Mixtral_8x7bOptionsType) {\n super(Mixtral_8x7bSchema, options);\n }\n}\n\nexport { Mixtral_8x7b, Mixtral_8x7bOptions, Mixtral_8x7bSchema, Mixtral_8x7bLiteral, type Mixtral_8x7bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst LlamaGuard_3_8bLiteral = \"llama-guard-3-8b\" as const;\n// https://huggingface.co/meta-llama/Llama-Guard-3-8B\nconst LlamaGuard_3_8bDescription = \"Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.\";\n\nconst LlamaGuard_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: LlamaGuard_3_8bLiteral,\n description: LlamaGuard_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst LlamaGuard_3_8bOptions = BaseChatModelOptions;\ntype LlamaGuard_3_8bOptionsType = z.infer<typeof LlamaGuard_3_8bOptions>;\n\nclass LlamaGuard_3_8b extends BaseChatModelGroq {\n constructor(options: LlamaGuard_3_8bOptionsType) {\n super(LlamaGuard_3_8bSchema, options);\n }\n}\n\nexport { LlamaGuard_3_8b, LlamaGuard_3_8bOptions, LlamaGuard_3_8bSchema, LlamaGuard_3_8bLiteral, type LlamaGuard_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8bLiteral = \"llama3-8b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct\nconst Llama_3_8bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8bLiteral,\n description: Llama_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8bOptions = BaseChatModelOptions;\ntype Llama_3_8bOptionsType = z.infer<typeof Llama_3_8bOptions>;\n\nclass Llama_3_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_8bOptionsType) {\n super(Llama_3_8bSchema, options);\n }\n}\n\nexport { Llama_3_8b, Llama_3_8bOptions, Llama_3_8bSchema, Llama_3_8bLiteral, type Llama_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70bLiteral = \"llama3-70b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct\nconst Llama_3_70bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70bLiteral,\n description: Llama_3_70bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70bOptions = BaseChatModelOptions;\ntype Llama_3_70bOptionsType = z.infer<typeof Llama_3_70bOptions>;\n\nclass Llama_3_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_70bOptionsType) {\n super(Llama_3_70bSchema, options);\n }\n}\n\nexport { Llama_3_70b, Llama_3_70bOptions, Llama_3_70bSchema, Llama_3_70bLiteral, type Llama_3_70bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70b_Tool_UseLiteral = \"llama3-groq-70b-8192-tool-use-preview\" as const;\n// https://huggingface.co/Groq/Llama-3-Groq-70B-Tool-Use\nconst Llama_3_70b_Tool_UseDescription =\n \"This is the 70B parameter version of the Llama 3 Groq Tool Use model, \\\n specifically designed for advanced tool use and function calling tasks.\";\n\nconst Llama_3_70b_Tool_UseSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70b_Tool_UseLiteral,\n description: Llama_3_70b_Tool_UseDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70b_Tool_Use_Options = BaseChatModelOptions;\ntype Llama_3_70b_Tool_Use_OptionsType = z.infer<typeof Llama_3_70b_Tool_Use_Options>;\n\nclass Llama_3_70b_Tool_Use extends BaseChatModelGroq {\n constructor(options: Llama_3_70b_Tool_Use_OptionsType) {\n super(Llama_3_70b_Tool_UseSchema, options);\n }\n}\n\nexport {\n Llama_3_70b_Tool_Use,\n Llama_3_70b_Tool_Use_Options,\n Llama_3_70b_Tool_UseSchema,\n Llama_3_70b_Tool_UseLiteral,\n type Llama_3_70b_Tool_Use_OptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8b_Tool_UseLiteral = \"llama3-groq-8b-8192-tool-use-preview\" as const;\n// https://huggingface.co/Groq/Llama-3-Groq-8B-Tool-Use\nconst Llama_3_8b_Tool_UseDescription =\n \"This is the 8B parameter version of the Llama 3 Groq Tool Use model, \\\n specifically designed for advanced tool use and function calling tasks.\";\n\nconst Llama_3_8b_Tool_UseSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8b_Tool_UseLiteral,\n description: Llama_3_8b_Tool_UseDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8b_Tool_Use_Options = BaseChatModelOptions;\ntype Llama_3_8b_Tool_Use_OptionsType = z.infer<typeof Llama_3_8b_Tool_Use_Options>;\n\nclass Llama_3_8b_Tool_Use extends BaseChatModelGroq {\n constructor(options: Llama_3_8b_Tool_Use_OptionsType) {\n super(Llama_3_8b_Tool_UseSchema, options);\n }\n}\n\nexport {\n Llama_3_8b_Tool_Use,\n Llama_3_8b_Tool_Use_Options,\n Llama_3_8b_Tool_UseSchema,\n Llama_3_8b_Tool_UseLiteral,\n type Llama_3_8b_Tool_Use_OptionsType,\n};\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_11b_VisionLiteral = \"llama-3.2-11b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-11B-Vision\nconst Llama_3_2_11b_VisionDescription =\n \"The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, \\\n and answering general questions about an image. \\\n The models outperform many of the available open source and closed multimodal models on common industry benchmarks.\";\n\nconst Llama_3_2_11b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_11b_VisionLiteral,\n description: Llama_3_2_11b_VisionDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_11b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_11b_VisionOptionsType = z.infer<typeof Llama_3_2_11b_VisionOptions>;\n\nclass Llama_3_2_11b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_11b_VisionOptionsType) {\n super(Llama_3_2_11b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n Llama_3_2_11b_VisionLiteral,\n type Llama_3_2_11b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_3bLiteral = \"llama-3.2-3b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-3B\nconst Llama_3_2_3bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_3bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_3bLiteral,\n description: Llama_3_2_3bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_3b_Options = BaseChatModelOptions;\ntype Llama_3_2_3b_OptionsType = z.infer<typeof Llama_3_2_3b_Options>;\n\nclass Llama_3_2_3b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_3b_OptionsType) {\n super(Llama_3_2_3bSchema, options);\n }\n}\n\nexport { Llama_3_2_3b, Llama_3_2_3b_Options, Llama_3_2_3bSchema, Llama_3_2_3bLiteral, type Llama_3_2_3b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_1bLiteral = \"llama-3.2-1b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-1B\nconst Llama_3_2_1bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_1bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_1bLiteral,\n description: Llama_3_2_1bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_1b_Options = BaseChatModelOptions;\ntype Llama_3_2_1b_OptionsType = z.infer<typeof Llama_3_2_1b_Options>;\n\nclass Llama_3_2_1b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_1b_OptionsType) {\n super(Llama_3_2_1bSchema, options);\n }\n}\n\nexport { Llama_3_2_1b, Llama_3_2_1b_Options, Llama_3_2_1bSchema, Llama_3_2_1bLiteral, type Llama_3_2_1b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_70bLiteral = \"llama-3.1-70b-versatile\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_70bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_70bLiteral,\n description: Llama_3_1_70bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_70b_Options = BaseChatModelOptions;\ntype Llama_3_1_70b_OptionsType = z.infer<typeof Llama_3_1_70b_Options>;\n\nclass Llama_3_1_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_70b_OptionsType) {\n super(Llama_3_1_70bSchema, options);\n }\n}\n\nexport { Llama_3_1_70b, Llama_3_1_70b_Options, Llama_3_1_70bSchema, Llama_3_1_70bLiteral, type Llama_3_1_70b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_8bLiteral = \"llama-3.1-8b-instant\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_8bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_8bLiteral,\n description: Llama_3_1_8bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_8b_Options = BaseChatModelOptions;\ntype Llama_3_1_8b_OptionsType = z.infer<typeof Llama_3_1_8b_Options>;\n\nclass Llama_3_1_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_8b_OptionsType) {\n super(Llama_3_1_8bSchema, options);\n }\n}\n\nexport { Llama_3_1_8b, Llama_3_1_8b_Options, Llama_3_1_8bSchema, Llama_3_1_8bLiteral, type Llama_3_1_8b_OptionsType };\n","import { z } from \"zod\";\n\nimport { ChatModelSchemaType, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderError, ProviderV1 } from \"@adaline/provider\";\n\nimport * as Models from \"../models\";\n\nconst ProviderLiteral = \"groq\";\nclass Groq<C extends Models.BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {\n readonly version = \"v1\" as const;\n readonly name = ProviderLiteral;\n static readonly baseUrl = \"https://api.groq.com/openai/v1\";\n\n private readonly chatModelFactories: Record<\n string,\n {\n model: { new (options: any): ChatModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: ChatModelSchemaType;\n }\n > = {\n [Models.Gemma_7b_ITLiteral]: {\n model: Models.Gemma_7b_IT,\n modelOptions: Models.Gemma_7b_ITOptions,\n modelSchema: Models.Gemma_7b_ITSchema,\n },\n [Models.Gemma2_9b_ITLiteral]: {\n model: Models.Gemma2_9b_IT,\n modelOptions: Models.Gemma2_9b_ITOptions,\n modelSchema: Models.Gemma2_9b_ITSchema,\n },\n [Models.LlamaGuard_3_8bLiteral]: {\n model: Models.LlamaGuard_3_8b,\n modelOptions: Models.LlamaGuard_3_8bOptions,\n modelSchema: Models.LlamaGuard_3_8bSchema,\n },\n [Models.Llama_3_8bLiteral]: {\n model: Models.Llama_3_8b,\n modelOptions: Models.Llama_3_8bOptions,\n modelSchema: Models.Llama_3_8bSchema,\n },\n [Models.Llama_3_70bLiteral]: {\n model: Models.Llama_3_70b,\n modelOptions: Models.Llama_3_70bOptions,\n modelSchema: Models.Llama_3_70bSchema,\n },\n [Models.Llama_3_1_8bLiteral]: {\n model: Models.Llama_3_1_8b,\n modelOptions: Models.Llama_3_1_8b_Options,\n modelSchema: Models.Llama_3_1_8bSchema,\n },\n [Models.Llama_3_8b_Tool_UseLiteral]: {\n model: Models.Llama_3_8b_Tool_Use,\n modelOptions: Models.Llama_3_8b_Tool_Use_Options,\n modelSchema: Models.Llama_3_8b_Tool_UseSchema,\n },\n [Models.Llama_3_1_70bLiteral]: {\n model: Models.Llama_3_1_70b,\n modelOptions: Models.Llama_3_1_70b_Options,\n modelSchema: Models.Llama_3_1_70bSchema,\n },\n [Models.Llama_3_70b_Tool_UseLiteral]: {\n model: Models.Llama_3_70b_Tool_Use,\n modelOptions: Models.Llama_3_70b_Tool_Use_Options,\n modelSchema: Models.Llama_3_70b_Tool_UseSchema,\n },\n [Models.Llama_3_2_11b_VisionLiteral]: {\n model: Models.Llama_3_2_11b_Vision,\n modelOptions: Models.Llama_3_2_11b_VisionOptions,\n modelSchema: Models.Llama_3_2_11b_VisionSchema,\n },\n [Models.Llama_3_2_3bLiteral]: {\n model: Models.Llama_3_2_3b,\n modelOptions: Models.Llama_3_2_3b_Options,\n modelSchema: Models.Llama_3_2_3bSchema,\n },\n [Models.Llama_3_2_1bLiteral]: {\n model: Models.Llama_3_2_1b,\n modelOptions: Models.Llama_3_2_1b_Options,\n modelSchema: Models.Llama_3_2_1bSchema,\n },\n [Models.Mixtral_8x7bLiteral]: {\n model: Models.Mixtral_8x7b,\n modelOptions: Models.Mixtral_8x7bOptions,\n modelSchema: Models.Mixtral_8x7bSchema,\n },\n };\n\n private readonly embeddingModelFactories: Record<\n string,\n {\n model: { new (options: any): EmbeddingModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: EmbeddingModelSchemaType;\n }\n > = {};\n\n chatModelLiterals(): string[] {\n return Object.keys(this.chatModelFactories);\n }\n\n chatModelSchemas(): Record<string, ChatModelSchemaType> {\n return Object.keys(this.chatModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.chatModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, ChatModelSchemaType>\n );\n }\n\n chatModel(options: C): ChatModelV1 {\n const modelName = options.modelName;\n if (!(modelName in this.chatModelFactories)) {\n throw new ProviderError({\n info: `Groq chat model: ${modelName} not found`,\n cause: new Error(`Groq chat model: ${modelName} not found, available chat models: \n ${this.chatModelLiterals().join(\", \")}`),\n });\n }\n\n const model = this.chatModelFactories[modelName].model;\n const parsedOptions = this.chatModelFactories[modelName].modelOptions.parse(options);\n return new model(parsedOptions);\n }\n\n embeddingModelLiterals(): string[] {\n return Object.keys(this.embeddingModelFactories);\n }\n\n embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType> {\n return Object.keys(this.embeddingModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.embeddingModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, EmbeddingModelSchemaType>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n embeddingModel(options: E): EmbeddingModelV1 {\n throw new ProviderError({\n info: \"Groq does not support embedding models yet\",\n cause: new Error(\"Groq does not support embedding models yet\"),\n });\n }\n}\n\nexport { Groq };\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { RangeConfigItem, CHAT_CONFIG, MultiStringConfigItem, SelectStringConfig
|
|
|
2
2
|
import { z as z$1 } from 'zod';
|
|
3
3
|
import { OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum, OpenAIChatModelRolesMap, OpenAIChatModelTextToolModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelModalities, BaseChatModel } from '@adaline/openai';
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
`)):
|
|
7
|
-
`));}),r}};var I=RangeConfigItem({param:"temperature",title:CHAT_CONFIG.TEMPERATURE.title,description:CHAT_CONFIG.TEMPERATURE.description,min:0,max:2,step:.01,default:1}),S=a=>RangeConfigItem({param:"max_tokens",title:CHAT_CONFIG.MAX_TOKENS.title,description:CHAT_CONFIG.MAX_TOKENS.description,min:0,max:a,step:1,default:0}),G=MultiStringConfigItem({param:"stop",title:CHAT_CONFIG.STOP(4).title,description:CHAT_CONFIG.STOP(4).description,max:4}),A=RangeConfigItem({param:"top_p",title:CHAT_CONFIG.TOP_P.title,description:CHAT_CONFIG.TOP_P.description,min:0,max:1,step:.01,default:1}),E=RangeConfigItem({param:"frequency_penalty",title:CHAT_CONFIG.FREQUENCY_PENALTY.title,description:CHAT_CONFIG.FREQUENCY_PENALTY.description,min:-2,max:2,step:.01,default:0}),R=RangeConfigItem({param:"presence_penalty",title:CHAT_CONFIG.PRESENCE_PENALTY.title,description:CHAT_CONFIG.PRESENCE_PENALTY.description,min:-2,max:2,step:.01,default:0}),q=RangeConfigItem({param:"seed",title:CHAT_CONFIG.SEED.title,description:CHAT_CONFIG.SEED.description,min:0,max:1e6,step:1,default:0}),B=SelectStringConfigItem({param:"response_format",title:CHAT_CONFIG.RESPONSE_FORMAT.title,description:CHAT_CONFIG.RESPONSE_FORMAT.description,default:"text",choices:["text","json_object"]}),k=SelectStringConfigItem({param:"tool_choice",title:"Tool choice",description:"Controls which (if any) tool is called by the model. 'none' means the model will not call a function. 'auto' means the model can pick between generating a message or calling a tool.",default:"auto",choices:["auto","required","none"]});var _e=a=>z$1.object({temperature:I.schema,maxTokens:S(a).schema,stop:G.schema,topP:A.schema,frequencyPenalty:E.schema,presencePenalty:R.schema,seed:q.schema.transform(e=>e===0?void 0:e),responseFormat:B.schema,toolChoice:k.schema}),he=a=>({temperature:I.def,maxTokens:S(a).def,stop:G.def,topP:A.def,frequencyPenalty:E.def,presencePenalty:R.def,seed:q.def,responseFormat:B.def,toolChoice:k.def});var o={base:a=>({def:he(a),schema:_e(a)})};var z="gemma-7b-it",Fe="Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models.",v=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:z,description:Fe,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),fe=n,c=class extends s{constructor(e){super(v,e);}};var P="gemma2-9b-it",$e="Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models.",U=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:P,description:$e,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),be=n,_=class extends s{constructor(e){super(U,e);}};var N="mixtral-8x7b-32768",We="The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts.",w=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:N,description:We,maxInputTokens:32768,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ue=n,h=class extends s{constructor(e){super(w,e);}};var F="llama-guard-3-8b",no="Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.",V=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:F,description:no,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Me=n,f=class extends s{constructor(e){super(V,e);}};var D="llama3-8b-8192",co="The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",j=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:D,description:co,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Te=n,b=class extends s{constructor(e){super(j,e);}};var K="llama3-70b-8192",Mo="The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",Y=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:K,description:Mo,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Oe=n,u=class extends s{constructor(e){super(Y,e);}};var $="llama3-groq-70b-8192-tool-use-preview",xo="This is the 70B parameter version of the Llama 3 Groq Tool Use model, specifically designed for advanced tool use and function calling tasks.",Q=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:$,description:xo,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ye=n,M=class extends s{constructor(e){super(Q,e);}};var X="llama3-groq-8b-8192-tool-use-preview",Eo="This is the 8B parameter version of the Llama 3 Groq Tool Use model, specifically designed for advanced tool use and function calling tasks.",Z=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:X,description:Eo,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Ce=n,T=class extends s{constructor(e){super(Z,e);}};var H="llama-3.2-11b-vision-preview",vo="The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The models outperform many of the available open source and closed multimodal models on common industry benchmarks.",J=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelModalitiesEnum).parse({name:H,description:vo,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Le=n,O=class extends s{constructor(e){super(J,e);}};var W="llama-3.2-3b-preview",Vo="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",ee=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:W,description:Vo,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),xe=n,y=class extends s{constructor(e){super(ee,e);}};var oe="llama-3.2-1b-preview",Qo="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",ae=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:oe,description:Qo,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ge=n,C=class extends s{constructor(e){super(ae,e);}};var te="llama-3.1-70b-versatile",ea="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",se=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:te,description:ea,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Ie=n,L=class extends s{constructor(e){super(se,e);}};var ne="llama-3.1-8b-instant",ma="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",me=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:ne,description:ma,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Se=n,x=class extends s{constructor(e){super(me,e);}};var ia="groq",d=class{constructor(){this.version="v1";this.name=ia;this.chatModelFactories={[z]:{model:c,modelOptions:fe,modelSchema:v},[P]:{model:_,modelOptions:be,modelSchema:U},[F]:{model:f,modelOptions:Me,modelSchema:V},[D]:{model:b,modelOptions:Te,modelSchema:j},[K]:{model:u,modelOptions:Oe,modelSchema:Y},[ne]:{model:x,modelOptions:Se,modelSchema:me},[X]:{model:T,modelOptions:Ce,modelSchema:Z},[te]:{model:L,modelOptions:Ie,modelSchema:se},[$]:{model:M,modelOptions:ye,modelSchema:Q},[H]:{model:O,modelOptions:Le,modelSchema:J},[W]:{model:y,modelOptions:xe,modelSchema:ee},[oe]:{model:C,modelOptions:ge,modelSchema:ae},[N]:{model:h,modelOptions:ue,modelSchema:w}};this.embeddingModelFactories={};}chatModelLiterals(){return Object.keys(this.chatModelFactories)}chatModelSchemas(){return Object.keys(this.chatModelFactories).reduce((e,t)=>(e[t]=this.chatModelFactories[t].modelSchema,e),{})}chatModel(e){let t=e.modelName;if(!t)throw new ProviderError({info:"options.modelName is required",cause:new Error("options.modelName is required")});if(!(t in this.chatModelFactories))throw new ProviderError({info:`Groq chat model: ${t} not found`,cause:new Error(`Groq chat model: ${t} not found, available chat models:
|
|
8
|
-
${this.chatModelLiterals().join(", ")}`)});let r=this.chatModelFactories[
|
|
5
|
+
var t=z$1.object({modelName:z$1.string().min(1),apiKey:z$1.string().min(1)}),a=class extends BaseChatModel{constructor(l,r){let n=t.parse(r),i=d.baseUrl;super(l,{modelName:n.modelName,apiKey:n.apiKey,baseUrl:i,completeChatUrl:`${i}/chat/completions`,streamChatUrl:`${i}/chat/completions`});this.version="v1";this.modelSchema=l,this.modelName=n.modelName,this.groqApiKey=n.apiKey;}transformMessages(l){let r=super.transformMessages(l);return r.messages.forEach(n=>{n.role==="system"?typeof n.content!="string"&&(n.content=n.content.map(i=>i.text).join(`
|
|
6
|
+
`)):n.role==="assistant"&&n.content&&typeof n.content!="string"&&(n.content=n.content.map(i=>i.text).join(`
|
|
7
|
+
`));}),r}};var I=RangeConfigItem({param:"temperature",title:CHAT_CONFIG.TEMPERATURE.title,description:CHAT_CONFIG.TEMPERATURE.description,min:0,max:2,step:.01,default:1}),S=s=>RangeConfigItem({param:"max_tokens",title:CHAT_CONFIG.MAX_TOKENS.title,description:CHAT_CONFIG.MAX_TOKENS.description,min:0,max:s,step:1,default:0}),G=MultiStringConfigItem({param:"stop",title:CHAT_CONFIG.STOP(4).title,description:CHAT_CONFIG.STOP(4).description,max:4}),A=RangeConfigItem({param:"top_p",title:CHAT_CONFIG.TOP_P.title,description:CHAT_CONFIG.TOP_P.description,min:0,max:1,step:.01,default:1}),E=RangeConfigItem({param:"frequency_penalty",title:CHAT_CONFIG.FREQUENCY_PENALTY.title,description:CHAT_CONFIG.FREQUENCY_PENALTY.description,min:-2,max:2,step:.01,default:0}),R=RangeConfigItem({param:"presence_penalty",title:CHAT_CONFIG.PRESENCE_PENALTY.title,description:CHAT_CONFIG.PRESENCE_PENALTY.description,min:-2,max:2,step:.01,default:0}),q=RangeConfigItem({param:"seed",title:CHAT_CONFIG.SEED.title,description:CHAT_CONFIG.SEED.description,min:0,max:1e6,step:1,default:0}),B=SelectStringConfigItem({param:"response_format",title:CHAT_CONFIG.RESPONSE_FORMAT.title,description:CHAT_CONFIG.RESPONSE_FORMAT.description,default:"text",choices:["text","json_object"]}),k=SelectStringConfigItem({param:"tool_choice",title:"Tool choice",description:"Controls which (if any) tool is called by the model. 'none' means the model will not call a function. 'auto' means the model can pick between generating a message or calling a tool.",default:"auto",choices:["auto","required","none"]});var ie=s=>z$1.object({temperature:I.schema,maxTokens:S(s).schema,stop:G.schema,topP:A.schema,frequencyPenalty:E.schema,presencePenalty:R.schema,seed:q.schema.transform(e=>e===0?void 0:e),responseFormat:B.schema,toolChoice:k.schema}),re=s=>({temperature:I.def,maxTokens:S(s).def,stop:G.def,topP:A.def,frequencyPenalty:E.def,presencePenalty:R.def,seed:q.def,responseFormat:B.def,toolChoice:k.def});var o={base:s=>({def:re(s),schema:ie(s)})};var z="gemma-7b-it",qe="Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models.",v=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:z,description:qe,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),pe=t,c=class extends a{constructor(e){super(v,e);}};var P="gemma2-9b-it",Ue="Gemma is a family of lightweight, state-of-the-art open models from Google, built from the same research and technology used to create the Gemini models.",U=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:P,description:Ue,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),de=t,_=class extends a{constructor(e){super(U,e);}};var N="mixtral-8x7b-32768",je="The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts.",w=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:N,description:je,maxInputTokens:32768,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),ce=t,h=class extends a{constructor(e){super(w,e);}};var F="llama-guard-3-8b",Ze="Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.",V=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:F,description:Ze,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),_e=t,M=class extends a{constructor(e){super(V,e);}};var D="llama3-8b-8192",ao="The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",j=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:D,description:ao,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),he=t,f=class extends a{constructor(e){super(j,e);}};var K="llama3-70b-8192",io="The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks.",Y=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:K,description:io,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),Me=t,b=class extends a{constructor(e){super(Y,e);}};var $="llama3-groq-70b-8192-tool-use-preview",Mo="This is the 70B parameter version of the Llama 3 Groq Tool Use model, specifically designed for advanced tool use and function calling tasks.",Q=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:$,description:Mo,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),fe=t,T=class extends a{constructor(e){super(Q,e);}};var X="llama3-groq-8b-8192-tool-use-preview",yo="This is the 8B parameter version of the Llama 3 Groq Tool Use model, specifically designed for advanced tool use and function calling tasks.",Z=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:X,description:yo,maxInputTokens:8192,maxOutputTokens:4096,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(4096).def,schema:o.base(4096).schema}}),be=t,u=class extends a{constructor(e){super(Z,e);}};var H="llama-3.2-11b-vision-preview",So="The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, and answering general questions about an image. The models outperform many of the available open source and closed multimodal models on common industry benchmarks.",J=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelModalitiesEnum).parse({name:H,description:So,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Te=t,O=class extends a{constructor(e){super(J,e);}};var W="llama-3.2-3b-preview",Bo="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",ee=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:W,description:Bo,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ue=t,y=class extends a{constructor(e){super(ee,e);}};var oe="llama-3.2-1b-preview",No="The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.",ae=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:oe,description:No,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Oe=t,C=class extends a{constructor(e){super(ae,e);}};var te="llama-3.1-70b-versatile",Ko="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",se=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:te,description:Ko,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),ye=t,L=class extends a{constructor(e){super(se,e);}};var le="llama-3.1-8b-instant",Ho="The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.",ne=ChatModelSchema(OpenAIChatModelRoles,OpenAIChatModelTextToolModalitiesEnum).parse({name:le,description:Ho,maxInputTokens:128e3,maxOutputTokens:8192,roles:OpenAIChatModelRolesMap,modalities:OpenAIChatModelTextToolModalities,config:{def:o.base(8192).def,schema:o.base(8192).schema}}),Ce=t,x=class extends a{constructor(e){super(ne,e);}};var Jo="groq",d=class{constructor(){this.version="v1";this.name=Jo;this.chatModelFactories={[z]:{model:c,modelOptions:pe,modelSchema:v},[P]:{model:_,modelOptions:de,modelSchema:U},[F]:{model:M,modelOptions:_e,modelSchema:V},[D]:{model:f,modelOptions:he,modelSchema:j},[K]:{model:b,modelOptions:Me,modelSchema:Y},[le]:{model:x,modelOptions:Ce,modelSchema:ne},[X]:{model:u,modelOptions:be,modelSchema:Z},[te]:{model:L,modelOptions:ye,modelSchema:se},[$]:{model:T,modelOptions:fe,modelSchema:Q},[H]:{model:O,modelOptions:Te,modelSchema:J},[W]:{model:y,modelOptions:ue,modelSchema:ee},[oe]:{model:C,modelOptions:Oe,modelSchema:ae},[N]:{model:h,modelOptions:ce,modelSchema:w}};this.embeddingModelFactories={};}chatModelLiterals(){return Object.keys(this.chatModelFactories)}chatModelSchemas(){return Object.keys(this.chatModelFactories).reduce((e,l)=>(e[l]=this.chatModelFactories[l].modelSchema,e),{})}chatModel(e){let l=e.modelName;if(!(l in this.chatModelFactories))throw new ProviderError({info:`Groq chat model: ${l} not found`,cause:new Error(`Groq chat model: ${l} not found, available chat models:
|
|
8
|
+
${this.chatModelLiterals().join(", ")}`)});let r=this.chatModelFactories[l].model,n=this.chatModelFactories[l].modelOptions.parse(e);return new r(n)}embeddingModelLiterals(){return Object.keys(this.embeddingModelFactories)}embeddingModelSchemas(){return Object.keys(this.embeddingModelFactories).reduce((e,l)=>(e[l]=this.embeddingModelFactories[l].modelSchema,e),{})}embeddingModel(e){throw new ProviderError({info:"Groq does not support embedding models yet",cause:new Error("Groq does not support embedding models yet")})}};d.baseUrl="https://api.groq.com/openai/v1";
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export { a as BaseChatModelGroq, t as BaseChatModelOptions, _ as Gemma2_9b_IT, P as Gemma2_9b_ITLiteral, de as Gemma2_9b_ITOptions, U as Gemma2_9b_ITSchema, c as Gemma_7b_IT, z as Gemma_7b_ITLiteral, pe as Gemma_7b_ITOptions, v as Gemma_7b_ITSchema, d as Groq, M as LlamaGuard_3_8b, F as LlamaGuard_3_8bLiteral, _e as LlamaGuard_3_8bOptions, V as LlamaGuard_3_8bSchema, L as Llama_3_1_70b, te as Llama_3_1_70bLiteral, se as Llama_3_1_70bSchema, ye as Llama_3_1_70b_Options, x as Llama_3_1_8b, le as Llama_3_1_8bLiteral, ne as Llama_3_1_8bSchema, Ce as Llama_3_1_8b_Options, O as Llama_3_2_11b_Vision, H as Llama_3_2_11b_VisionLiteral, Te as Llama_3_2_11b_VisionOptions, J as Llama_3_2_11b_VisionSchema, C as Llama_3_2_1b, oe as Llama_3_2_1bLiteral, ae as Llama_3_2_1bSchema, Oe as Llama_3_2_1b_Options, y as Llama_3_2_3b, W as Llama_3_2_3bLiteral, ee as Llama_3_2_3bSchema, ue as Llama_3_2_3b_Options, b as Llama_3_70b, K as Llama_3_70bLiteral, Me as Llama_3_70bOptions, Y as Llama_3_70bSchema, T as Llama_3_70b_Tool_Use, $ as Llama_3_70b_Tool_UseLiteral, Q as Llama_3_70b_Tool_UseSchema, fe as Llama_3_70b_Tool_Use_Options, f as Llama_3_8b, D as Llama_3_8bLiteral, he as Llama_3_8bOptions, j as Llama_3_8bSchema, u as Llama_3_8b_Tool_Use, X as Llama_3_8b_Tool_UseLiteral, Z as Llama_3_8b_Tool_UseSchema, be as Llama_3_8b_Tool_Use_Options, h as Mixtral_8x7b, N as Mixtral_8x7bLiteral, ce as Mixtral_8x7bOptions, w as Mixtral_8x7bSchema };
|
|
11
11
|
//# sourceMappingURL=index.mjs.map
|
|
12
12
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/models/chat-models/base-chat-model.groq.ts","../src/configs/chat-model/common.config.chat-model.groq.ts","../src/configs/chat-model/base.config.chat-model.groq.ts","../src/configs/configs.groq.ts","../src/models/chat-models/gemma-7b-it.groq.ts","../src/models/chat-models/gemma2-9b-it.groq.ts","../src/models/chat-models/mixtral-8x7b.groq.ts","../src/models/chat-models/llama-guard-3-8b.groq.ts","../src/models/chat-models/llama-3-8b.groq.ts","../src/models/chat-models/llama-3-70b.groq.ts","../src/models/chat-models/llama-3-70b-tool-use.groq.ts","../src/models/chat-models/llama-3-8b-tool-use.groq.ts","../src/models/chat-models/llama-3-2-11b-vision.groq.ts","../src/models/chat-models/llama-3-2-3b.groq.ts","../src/models/chat-models/llama-3-2-1b.groq.ts","../src/models/chat-models/llama-3-1-70b.groq.ts","../src/models/chat-models/llama-3-1-8b.groq.ts","../src/provider/provider.groq.ts"],"names":["BaseChatModelOptions","z","BaseChatModelGroq","BaseChatModel","modelSchema","options","parsedOptions","baseUrl","Groq","messages","transformedMessages","message","content","temperature","RangeConfigItem","CHAT_CONFIG","maxTokens","maxOutputTokens","stop","MultiStringConfigItem","topP","frequencyPenalty","presencePenalty","seed","responseFormat","SelectStringConfigItem","toolChoice","ChatModelBaseConfigSchema","value","ChatModelBaseConfigDef","GroqChatModelConfigs","Gemma_7b_ITLiteral","Gemma_7b_ITDescription","Gemma_7b_ITSchema","ChatModelSchema","OpenAIChatModelRoles","OpenAIChatModelTextToolModalitiesEnum","OpenAIChatModelRolesMap","OpenAIChatModelTextToolModalities","Gemma_7b_ITOptions","Gemma_7b_IT","Gemma2_9b_ITLiteral","Gemma2_9b_ITDescription","Gemma2_9b_ITSchema","Gemma2_9b_ITOptions","Gemma2_9b_IT","Mixtral_8x7bLiteral","Mixtral_8x7bDescription","Mixtral_8x7bSchema","Mixtral_8x7bOptions","Mixtral_8x7b","LlamaGuard_3_8bLiteral","LlamaGuard_3_8bDescription","LlamaGuard_3_8bSchema","LlamaGuard_3_8bOptions","LlamaGuard_3_8b","Llama_3_8bLiteral","Llama_3_8bDescription","Llama_3_8bSchema","Llama_3_8bOptions","Llama_3_8b","Llama_3_70bLiteral","Llama_3_70bDescription","Llama_3_70bSchema","Llama_3_70bOptions","Llama_3_70b","Llama_3_70b_Tool_UseLiteral","Llama_3_70b_Tool_UseDescription","Llama_3_70b_Tool_UseSchema","Llama_3_70b_Tool_Use_Options","Llama_3_70b_Tool_Use","Llama_3_8b_Tool_UseLiteral","Llama_3_8b_Tool_UseDescription","Llama_3_8b_Tool_UseSchema","Llama_3_8b_Tool_Use_Options","Llama_3_8b_Tool_Use","Llama_3_2_11b_VisionLiteral","Llama_3_2_11b_VisionDescription","Llama_3_2_11b_VisionSchema","OpenAIChatModelModalitiesEnum","OpenAIChatModelModalities","Llama_3_2_11b_VisionOptions","Llama_3_2_11b_Vision","Llama_3_2_3bLiteral","Llama_3_2_3bDescription","Llama_3_2_3bSchema","Llama_3_2_3b_Options","Llama_3_2_3b","Llama_3_2_1bLiteral","Llama_3_2_1bDescription","Llama_3_2_1bSchema","Llama_3_2_1b_Options","Llama_3_2_1b","Llama_3_1_70bLiteral","Llama_3_1_70bDescription","Llama_3_1_70bSchema","Llama_3_1_70b_Options","Llama_3_1_70b","Llama_3_1_8bLiteral","Llama_3_1_8bDescription","Llama_3_1_8bSchema","Llama_3_1_8b_Options","Llama_3_1_8b","ProviderLiteral","acc","key","modelName","ProviderError","model","modelOptions","__spreadProps","__spreadValues"],"mappings":";;;;+bAQMA,IAAAA,CAAAA,CAAuBC,IAAE,MAAO,CAAA,CACpC,SAAWA,CAAAA,GAAAA,CAAE,MAAO,EAAA,CAAE,GAAI,CAAA,CAAC,CAC3B,CAAA,MAAA,CAAQA,GAAE,CAAA,MAAA,EAAS,CAAA,GAAA,CAAI,CAAC,CAC1B,CAAC,CAGKC,CAAAA,CAAAA,CAAN,cAAgCC,aAAc,CAO5C,WAAA,CAAY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AAM,CAAA,+BAAA,CACN,MAAO,IAAI,KAAA,CAAM,+BAA+B,CAClD,CAAC,CAEH,CAAA,GAAI,EAAED,CAAa,IAAA,IAAA,CAAK,oBACtB,MAAM,IAAIC,cAAc,CACtB,IAAA,CAAM,oBAAoBD,CAAS,CAAA,UAAA,CAAA,CACnC,MAAO,IAAI,KAAA,CAAM,oBAAoBA,CAAS,CAAA;AAAA,UAC1C,EAAA,IAAA,CAAK,mBAAoB,CAAA,IAAA,CAAK,IAAI,CAAC,CAAA,CAAE,CAC3C,CAAC,CAAA,CAGH,IAAME,CAAQ,CAAA,IAAA,CAAK,mBAAmBF,CAAS,CAAA,CAAE,MAC3CG,CAAeC,CAAAA,EAAAA,CAAAC,GAAA,EAChB1G,CAAAA,CAAAA,CAAAA,CADgB,CAEnB,SAAWqG,CAAAA,CACb,GACMpG,CAAgB,CAAA,IAAA,CAAK,mBAAmBoG,CAAS,CAAA,CAAE,aAAa,KAAMG,CAAAA,CAAY,EACxF,OAAO,IAAID,EAAMtG,CAAa,CAChC,CAEA,sBAAmC,EAAA,CACjC,OAAO,MAAA,CAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CACjD,CAEA,uBAAkE,CAChE,OAAO,OAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CAAE,CAAA,MAAA,CAC/C,CAACkG,CAAKC,CAAAA,CAAAA,IACJD,EAAIC,CAAG,CAAA,CAAI,KAAK,uBAAwBA,CAAAA,CAAG,EAAE,WACtCD,CAAAA,CAAAA,CAAAA,CAET,EACF,CACF,CAEA,cAAenG,CAAAA,CAAAA,CAA8B,CAC3C,MAAM,IAAIsG,cAAc,CACtB,IAAA,CAAM,yCACN,KAAO,CAAA,IAAI,MAAM,wCAAwC,CAC3D,CAAC,CACH,CACF,EApJMnG,CAAAA,CAGY,OAAU,CAAA,gCAAA","file":"index.mjs","sourcesContent":["import { z } from \"zod\";\n\nimport { BaseChatModel, OpenAIChatRequestMessageType } from \"@adaline/openai\";\nimport { ChatModelSchemaType, ParamsType } from \"@adaline/provider\";\nimport { MessageType } from \"@adaline/types\";\n\nimport { Groq } from \"../../provider\";\n\nconst BaseChatModelOptions = z.object({\n modelName: z.string().min(1),\n apiKey: z.string().min(1),\n});\ntype BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;\n\nclass BaseChatModelGroq extends BaseChatModel {\n readonly version = \"v1\" as const;\n modelSchema: ChatModelSchemaType;\n readonly modelName: string;\n\n private readonly groqApiKey: string;\n\n constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType) {\n const parsedOptions = BaseChatModelOptions.parse(options);\n const baseUrl = Groq.baseUrl;\n super(modelSchema, {\n modelName: parsedOptions.modelName,\n apiKey: parsedOptions.apiKey,\n baseUrl: baseUrl,\n completeChatUrl: `${baseUrl}/chat/completions`,\n streamChatUrl: `${baseUrl}/chat/completions`,\n });\n this.modelSchema = modelSchema;\n this.modelName = parsedOptions.modelName;\n this.groqApiKey = parsedOptions.apiKey;\n }\n\n transformMessages(messages: MessageType[]): ParamsType {\n const transformedMessages = super.transformMessages(messages) as { messages: OpenAIChatRequestMessageType[] };\n\n // Groq expects the content to be a string for system and assistant messages\n // OpenAI transformer takes care of validating role and modality\n transformedMessages.messages.forEach((message) => {\n if (message.role === \"system\") {\n if (typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n } else if (message.role === \"assistant\") {\n if (message.content && typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n }\n });\n\n return transformedMessages;\n }\n\n // TODO: streamChat needs it's own implementation, OpenAI stream transformer is skipping some chunks\n}\n\nexport { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType };\n","import { CHAT_CONFIG, MultiStringConfigItem, RangeConfigItem, SelectStringConfigItem } from \"@adaline/provider\";\n\nconst temperature = RangeConfigItem({\n param: \"temperature\",\n title: CHAT_CONFIG.TEMPERATURE.title,\n description: CHAT_CONFIG.TEMPERATURE.description,\n min: 0,\n max: 2,\n step: 0.01,\n default: 1,\n});\n\nconst maxTokens = (maxOutputTokens: number) =>\n RangeConfigItem({\n param: \"max_tokens\",\n title: CHAT_CONFIG.MAX_TOKENS.title,\n description: CHAT_CONFIG.MAX_TOKENS.description,\n min: 0,\n max: maxOutputTokens,\n step: 1,\n default: 0,\n });\n\nconst stop = MultiStringConfigItem({\n param: \"stop\",\n title: CHAT_CONFIG.STOP(4).title,\n description: CHAT_CONFIG.STOP(4).description,\n max: 4,\n});\n\nconst topP = RangeConfigItem({\n param: \"top_p\",\n title: CHAT_CONFIG.TOP_P.title,\n description: CHAT_CONFIG.TOP_P.description,\n min: 0,\n max: 1,\n step: 0.01,\n default: 1,\n});\n\nconst frequencyPenalty = RangeConfigItem({\n param: \"frequency_penalty\",\n title: CHAT_CONFIG.FREQUENCY_PENALTY.title,\n description: CHAT_CONFIG.FREQUENCY_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst presencePenalty = RangeConfigItem({\n param: \"presence_penalty\",\n title: CHAT_CONFIG.PRESENCE_PENALTY.title,\n description: CHAT_CONFIG.PRESENCE_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst seed = RangeConfigItem({\n param: \"seed\",\n title: CHAT_CONFIG.SEED.title,\n description: CHAT_CONFIG.SEED.description,\n min: 0,\n max: 1000000,\n step: 1,\n default: 0,\n});\n\nconst responseFormat = SelectStringConfigItem({\n param: \"response_format\",\n title: CHAT_CONFIG.RESPONSE_FORMAT.title,\n description: CHAT_CONFIG.RESPONSE_FORMAT.description,\n default: \"text\",\n choices: [\"text\", \"json_object\"],\n});\n\nconst toolChoice = SelectStringConfigItem({\n param: \"tool_choice\",\n title: \"Tool choice\",\n description:\n \"Controls which (if any) tool is called by the model. \\\n 'none' means the model will not call a function. \\\n 'auto' means the model can pick between generating a message or calling a tool.\",\n default: \"auto\",\n choices: [\"auto\", \"required\", \"none\"],\n});\n\nexport { frequencyPenalty, maxTokens, presencePenalty, seed, stop, temperature, toolChoice, topP, responseFormat };\n","import { z } from \"zod\";\n\nimport {\n frequencyPenalty,\n maxTokens,\n presencePenalty,\n responseFormat,\n seed,\n stop,\n temperature,\n toolChoice,\n topP,\n} from \"./common.config.chat-model.groq\";\n\nconst ChatModelBaseConfigSchema = (maxOutputTokens: number) =>\n z.object({\n temperature: temperature.schema,\n maxTokens: maxTokens(maxOutputTokens).schema,\n stop: stop.schema,\n topP: topP.schema,\n frequencyPenalty: frequencyPenalty.schema,\n presencePenalty: presencePenalty.schema,\n seed: seed.schema.transform((value) => (value === 0 ? undefined : value)),\n responseFormat: responseFormat.schema,\n toolChoice: toolChoice.schema,\n });\n\nconst ChatModelBaseConfigDef = (maxOutputTokens: number) =>\n ({\n temperature: temperature.def,\n maxTokens: maxTokens(maxOutputTokens).def,\n stop: stop.def,\n topP: topP.def,\n frequencyPenalty: frequencyPenalty.def,\n presencePenalty: presencePenalty.def,\n seed: seed.def,\n responseFormat: responseFormat.def,\n toolChoice: toolChoice.def,\n }) as const;\n\nexport { ChatModelBaseConfigDef, ChatModelBaseConfigSchema };\n","import { ChatModelBaseConfigDef, ChatModelBaseConfigSchema } from \"./chat-model\";\n\nconst GroqChatModelConfigs = {\n base: (maxOutputTokens: number) => ({\n def: ChatModelBaseConfigDef(maxOutputTokens),\n schema: ChatModelBaseConfigSchema(maxOutputTokens),\n }),\n} as const;\n\nexport { GroqChatModelConfigs };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma_7b_ITLiteral = \"gemma-7b-it\" as const;\n// https://huggingface.co/google/gemma-1.1-7b-it\nconst Gemma_7b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma_7b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma_7b_ITLiteral,\n description: Gemma_7b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma_7b_ITOptions = BaseChatModelOptions;\ntype Gemma_7b_ITOptionsType = z.infer<typeof Gemma_7b_ITOptions>;\n\nclass Gemma_7b_IT extends BaseChatModelGroq {\n constructor(options: Gemma_7b_ITOptionsType) {\n super(Gemma_7b_ITSchema, options);\n }\n}\n\nexport { Gemma_7b_IT, Gemma_7b_ITOptions, Gemma_7b_ITSchema, Gemma_7b_ITLiteral, type Gemma_7b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma2_9b_ITLiteral = \"gemma2-9b-it\" as const;\n// https://huggingface.co/google/gemma-2-9b-it\nconst Gemma2_9b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma2_9b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma2_9b_ITLiteral,\n description: Gemma2_9b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma2_9b_ITOptions = BaseChatModelOptions;\ntype Gemma2_9b_ITOptionsType = z.infer<typeof Gemma2_9b_ITOptions>;\n\nclass Gemma2_9b_IT extends BaseChatModelGroq {\n constructor(options: Gemma2_9b_ITOptionsType) {\n super(Gemma2_9b_ITSchema, options);\n }\n}\n\nexport { Gemma2_9b_IT, Gemma2_9b_ITOptions, Gemma2_9b_ITSchema, Gemma2_9b_ITLiteral, type Gemma2_9b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Mixtral_8x7bLiteral = \"mixtral-8x7b-32768\" as const;\n// https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1\nconst Mixtral_8x7bDescription = \"The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts.\";\n\nconst Mixtral_8x7bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Mixtral_8x7bLiteral,\n description: Mixtral_8x7bDescription,\n maxInputTokens: 32768,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Mixtral_8x7bOptions = BaseChatModelOptions;\ntype Mixtral_8x7bOptionsType = z.infer<typeof Mixtral_8x7bOptions>;\n\nclass Mixtral_8x7b extends BaseChatModelGroq {\n constructor(options: Mixtral_8x7bOptionsType) {\n super(Mixtral_8x7bSchema, options);\n }\n}\n\nexport { Mixtral_8x7b, Mixtral_8x7bOptions, Mixtral_8x7bSchema, Mixtral_8x7bLiteral, type Mixtral_8x7bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst LlamaGuard_3_8bLiteral = \"llama-guard-3-8b\" as const;\n// https://huggingface.co/meta-llama/Llama-Guard-3-8B\nconst LlamaGuard_3_8bDescription = \"Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.\";\n\nconst LlamaGuard_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: LlamaGuard_3_8bLiteral,\n description: LlamaGuard_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst LlamaGuard_3_8bOptions = BaseChatModelOptions;\ntype LlamaGuard_3_8bOptionsType = z.infer<typeof LlamaGuard_3_8bOptions>;\n\nclass LlamaGuard_3_8b extends BaseChatModelGroq {\n constructor(options: LlamaGuard_3_8bOptionsType) {\n super(LlamaGuard_3_8bSchema, options);\n }\n}\n\nexport { LlamaGuard_3_8b, LlamaGuard_3_8bOptions, LlamaGuard_3_8bSchema, LlamaGuard_3_8bLiteral, type LlamaGuard_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8bLiteral = \"llama3-8b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct\nconst Llama_3_8bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8bLiteral,\n description: Llama_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8bOptions = BaseChatModelOptions;\ntype Llama_3_8bOptionsType = z.infer<typeof Llama_3_8bOptions>;\n\nclass Llama_3_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_8bOptionsType) {\n super(Llama_3_8bSchema, options);\n }\n}\n\nexport { Llama_3_8b, Llama_3_8bOptions, Llama_3_8bSchema, Llama_3_8bLiteral, type Llama_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70bLiteral = \"llama3-70b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct\nconst Llama_3_70bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70bLiteral,\n description: Llama_3_70bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70bOptions = BaseChatModelOptions;\ntype Llama_3_70bOptionsType = z.infer<typeof Llama_3_70bOptions>;\n\nclass Llama_3_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_70bOptionsType) {\n super(Llama_3_70bSchema, options);\n }\n}\n\nexport { Llama_3_70b, Llama_3_70bOptions, Llama_3_70bSchema, Llama_3_70bLiteral, type Llama_3_70bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70b_Tool_UseLiteral = \"llama3-groq-70b-8192-tool-use-preview\" as const;\n// https://huggingface.co/Groq/Llama-3-Groq-70B-Tool-Use\nconst Llama_3_70b_Tool_UseDescription =\n \"This is the 70B parameter version of the Llama 3 Groq Tool Use model, \\\n specifically designed for advanced tool use and function calling tasks.\";\n\nconst Llama_3_70b_Tool_UseSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70b_Tool_UseLiteral,\n description: Llama_3_70b_Tool_UseDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70b_Tool_Use_Options = BaseChatModelOptions;\ntype Llama_3_70b_Tool_Use_OptionsType = z.infer<typeof Llama_3_70b_Tool_Use_Options>;\n\nclass Llama_3_70b_Tool_Use extends BaseChatModelGroq {\n constructor(options: Llama_3_70b_Tool_Use_OptionsType) {\n super(Llama_3_70b_Tool_UseSchema, options);\n }\n}\n\nexport {\n Llama_3_70b_Tool_Use,\n Llama_3_70b_Tool_Use_Options,\n Llama_3_70b_Tool_UseSchema,\n Llama_3_70b_Tool_UseLiteral,\n type Llama_3_70b_Tool_Use_OptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8b_Tool_UseLiteral = \"llama3-groq-8b-8192-tool-use-preview\" as const;\n// https://huggingface.co/Groq/Llama-3-Groq-8B-Tool-Use\nconst Llama_3_8b_Tool_UseDescription =\n \"This is the 8B parameter version of the Llama 3 Groq Tool Use model, \\\n specifically designed for advanced tool use and function calling tasks.\";\n\nconst Llama_3_8b_Tool_UseSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8b_Tool_UseLiteral,\n description: Llama_3_8b_Tool_UseDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8b_Tool_Use_Options = BaseChatModelOptions;\ntype Llama_3_8b_Tool_Use_OptionsType = z.infer<typeof Llama_3_8b_Tool_Use_Options>;\n\nclass Llama_3_8b_Tool_Use extends BaseChatModelGroq {\n constructor(options: Llama_3_8b_Tool_Use_OptionsType) {\n super(Llama_3_8b_Tool_UseSchema, options);\n }\n}\n\nexport {\n Llama_3_8b_Tool_Use,\n Llama_3_8b_Tool_Use_Options,\n Llama_3_8b_Tool_UseSchema,\n Llama_3_8b_Tool_UseLiteral,\n type Llama_3_8b_Tool_Use_OptionsType,\n};\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_11b_VisionLiteral = \"llama-3.2-11b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-11B-Vision\nconst Llama_3_2_11b_VisionDescription =\n \"The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, \\\n and answering general questions about an image. \\\n The models outperform many of the available open source and closed multimodal models on common industry benchmarks.\";\n\nconst Llama_3_2_11b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_11b_VisionLiteral,\n description: Llama_3_2_11b_VisionDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_11b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_11b_VisionOptionsType = z.infer<typeof Llama_3_2_11b_VisionOptions>;\n\nclass Llama_3_2_11b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_11b_VisionOptionsType) {\n super(Llama_3_2_11b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n Llama_3_2_11b_VisionLiteral,\n type Llama_3_2_11b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_3bLiteral = \"llama-3.2-3b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-3B\nconst Llama_3_2_3bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_3bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_3bLiteral,\n description: Llama_3_2_3bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_3b_Options = BaseChatModelOptions;\ntype Llama_3_2_3b_OptionsType = z.infer<typeof Llama_3_2_3b_Options>;\n\nclass Llama_3_2_3b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_3b_OptionsType) {\n super(Llama_3_2_3bSchema, options);\n }\n}\n\nexport { Llama_3_2_3b, Llama_3_2_3b_Options, Llama_3_2_3bSchema, Llama_3_2_3bLiteral, type Llama_3_2_3b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_1bLiteral = \"llama-3.2-1b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-1B\nconst Llama_3_2_1bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_1bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_1bLiteral,\n description: Llama_3_2_1bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_1b_Options = BaseChatModelOptions;\ntype Llama_3_2_1b_OptionsType = z.infer<typeof Llama_3_2_1b_Options>;\n\nclass Llama_3_2_1b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_1b_OptionsType) {\n super(Llama_3_2_1bSchema, options);\n }\n}\n\nexport { Llama_3_2_1b, Llama_3_2_1b_Options, Llama_3_2_1bSchema, Llama_3_2_1bLiteral, type Llama_3_2_1b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_70bLiteral = \"llama-3.1-70b-versatile\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_70bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_70bLiteral,\n description: Llama_3_1_70bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_70b_Options = BaseChatModelOptions;\ntype Llama_3_1_70b_OptionsType = z.infer<typeof Llama_3_1_70b_Options>;\n\nclass Llama_3_1_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_70b_OptionsType) {\n super(Llama_3_1_70bSchema, options);\n }\n}\n\nexport { Llama_3_1_70b, Llama_3_1_70b_Options, Llama_3_1_70bSchema, Llama_3_1_70bLiteral, type Llama_3_1_70b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_8bLiteral = \"llama-3.1-8b-instant\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_8bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_8bLiteral,\n description: Llama_3_1_8bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_8b_Options = BaseChatModelOptions;\ntype Llama_3_1_8b_OptionsType = z.infer<typeof Llama_3_1_8b_Options>;\n\nclass Llama_3_1_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_8b_OptionsType) {\n super(Llama_3_1_8bSchema, options);\n }\n}\n\nexport { Llama_3_1_8b, Llama_3_1_8b_Options, Llama_3_1_8bSchema, Llama_3_1_8bLiteral, type Llama_3_1_8b_OptionsType };\n","import { z } from \"zod\";\n\nimport { ChatModelSchemaType, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderError, ProviderV1 } from \"@adaline/provider\";\n\nimport {\n Gemma_7b_IT,\n Gemma_7b_ITLiteral,\n Gemma_7b_ITOptions,\n Gemma_7b_ITSchema,\n Gemma2_9b_IT,\n Gemma2_9b_ITLiteral,\n Gemma2_9b_ITOptions,\n Gemma2_9b_ITSchema,\n Llama_3_1_8b,\n Llama_3_1_8b_Options,\n Llama_3_1_8bLiteral,\n Llama_3_1_8bSchema,\n Llama_3_1_70b,\n Llama_3_1_70b_Options,\n Llama_3_1_70bLiteral,\n Llama_3_1_70bSchema,\n Llama_3_2_1b,\n Llama_3_2_1b_Options,\n Llama_3_2_1bLiteral,\n Llama_3_2_1bSchema,\n Llama_3_2_3b,\n Llama_3_2_3b_Options,\n Llama_3_2_3bLiteral,\n Llama_3_2_3bSchema,\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionLiteral,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n Llama_3_8b,\n Llama_3_8b_Tool_Use,\n Llama_3_8b_Tool_Use_Options,\n Llama_3_8b_Tool_UseLiteral,\n Llama_3_8b_Tool_UseSchema,\n Llama_3_8bLiteral,\n Llama_3_8bOptions,\n Llama_3_8bSchema,\n Llama_3_70b,\n Llama_3_70b_Tool_Use,\n Llama_3_70b_Tool_Use_Options,\n Llama_3_70b_Tool_UseLiteral,\n Llama_3_70b_Tool_UseSchema,\n Llama_3_70bLiteral,\n Llama_3_70bOptions,\n Llama_3_70bSchema,\n LlamaGuard_3_8b,\n LlamaGuard_3_8bLiteral,\n LlamaGuard_3_8bOptions,\n LlamaGuard_3_8bSchema,\n Mixtral_8x7b,\n Mixtral_8x7bLiteral,\n Mixtral_8x7bOptions,\n Mixtral_8x7bSchema,\n} from \"./../models\";\n\nconst ProviderLiteral = \"groq\";\nclass Groq<O extends Record<string, any> = Record<string, any>> implements ProviderV1<O> {\n readonly version = \"v1\" as const;\n readonly name = ProviderLiteral;\n static readonly baseUrl = \"https://api.groq.com/openai/v1\";\n\n private readonly chatModelFactories: Record<\n string,\n {\n model: { new (options: any): ChatModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: ChatModelSchemaType;\n }\n > = {\n [Gemma_7b_ITLiteral]: {\n model: Gemma_7b_IT,\n modelOptions: Gemma_7b_ITOptions,\n modelSchema: Gemma_7b_ITSchema,\n },\n [Gemma2_9b_ITLiteral]: {\n model: Gemma2_9b_IT,\n modelOptions: Gemma2_9b_ITOptions,\n modelSchema: Gemma2_9b_ITSchema,\n },\n [LlamaGuard_3_8bLiteral]: {\n model: LlamaGuard_3_8b,\n modelOptions: LlamaGuard_3_8bOptions,\n modelSchema: LlamaGuard_3_8bSchema,\n },\n [Llama_3_8bLiteral]: {\n model: Llama_3_8b,\n modelOptions: Llama_3_8bOptions,\n modelSchema: Llama_3_8bSchema,\n },\n [Llama_3_70bLiteral]: {\n model: Llama_3_70b,\n modelOptions: Llama_3_70bOptions,\n modelSchema: Llama_3_70bSchema,\n },\n [Llama_3_1_8bLiteral]: {\n model: Llama_3_1_8b,\n modelOptions: Llama_3_1_8b_Options,\n modelSchema: Llama_3_1_8bSchema,\n },\n [Llama_3_8b_Tool_UseLiteral]: {\n model: Llama_3_8b_Tool_Use,\n modelOptions: Llama_3_8b_Tool_Use_Options,\n modelSchema: Llama_3_8b_Tool_UseSchema,\n },\n [Llama_3_1_70bLiteral]: {\n model: Llama_3_1_70b,\n modelOptions: Llama_3_1_70b_Options,\n modelSchema: Llama_3_1_70bSchema,\n },\n [Llama_3_70b_Tool_UseLiteral]: {\n model: Llama_3_70b_Tool_Use,\n modelOptions: Llama_3_70b_Tool_Use_Options,\n modelSchema: Llama_3_70b_Tool_UseSchema,\n },\n [Llama_3_2_11b_VisionLiteral]: {\n model: Llama_3_2_11b_Vision,\n modelOptions: Llama_3_2_11b_VisionOptions,\n modelSchema: Llama_3_2_11b_VisionSchema,\n },\n [Llama_3_2_3bLiteral]: {\n model: Llama_3_2_3b,\n modelOptions: Llama_3_2_3b_Options,\n modelSchema: Llama_3_2_3bSchema,\n },\n [Llama_3_2_1bLiteral]: {\n model: Llama_3_2_1b,\n modelOptions: Llama_3_2_1b_Options,\n modelSchema: Llama_3_2_1bSchema,\n },\n [Mixtral_8x7bLiteral]: {\n model: Mixtral_8x7b,\n modelOptions: Mixtral_8x7bOptions,\n modelSchema: Mixtral_8x7bSchema,\n },\n };\n\n private readonly embeddingModelFactories: Record<\n string,\n {\n model: { new (options: any): EmbeddingModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: EmbeddingModelSchemaType;\n }\n > = {};\n\n chatModelLiterals(): string[] {\n return Object.keys(this.chatModelFactories);\n }\n\n chatModelSchemas(): Record<string, ChatModelSchemaType> {\n return Object.keys(this.chatModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.chatModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, ChatModelSchemaType>\n );\n }\n\n chatModel(options: O): ChatModelV1 {\n const modelName = options.modelName;\n if (!modelName) {\n throw new ProviderError({\n info: \"options.modelName is required\",\n cause: new Error(\"options.modelName is required\"),\n });\n }\n if (!(modelName in this.chatModelFactories)) {\n throw new ProviderError({\n info: `Groq chat model: ${modelName} not found`,\n cause: new Error(`Groq chat model: ${modelName} not found, available chat models: \n ${this.chatModelLiterals().join(\", \")}`),\n });\n }\n\n const model = this.chatModelFactories[modelName].model;\n const modelOptions = {\n ...options,\n modelName: modelName,\n };\n const parsedOptions = this.chatModelFactories[modelName].modelOptions.parse(modelOptions);\n return new model(parsedOptions);\n }\n\n embeddingModelLiterals(): string[] {\n return Object.keys(this.embeddingModelFactories);\n }\n\n embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType> {\n return Object.keys(this.embeddingModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.embeddingModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, EmbeddingModelSchemaType>\n );\n }\n\n embeddingModel(options: O): EmbeddingModelV1 {\n throw new ProviderError({\n info: \"Groq does not support embedding models\",\n cause: new Error(\"Groq does not support embedding models\"),\n });\n }\n}\n\nexport { Groq };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/models/chat-models/base-chat-model.groq.ts","../src/configs/chat-model/common.config.chat-model.groq.ts","../src/configs/chat-model/base.config.chat-model.groq.ts","../src/configs/configs.groq.ts","../src/models/chat-models/gemma-7b-it.groq.ts","../src/models/chat-models/gemma2-9b-it.groq.ts","../src/models/chat-models/mixtral-8x7b.groq.ts","../src/models/chat-models/llama-guard-3-8b.groq.ts","../src/models/chat-models/llama-3-8b.groq.ts","../src/models/chat-models/llama-3-70b.groq.ts","../src/models/chat-models/llama-3-70b-tool-use.groq.ts","../src/models/chat-models/llama-3-8b-tool-use.groq.ts","../src/models/chat-models/llama-3-2-11b-vision.groq.ts","../src/models/chat-models/llama-3-2-3b.groq.ts","../src/models/chat-models/llama-3-2-1b.groq.ts","../src/models/chat-models/llama-3-1-70b.groq.ts","../src/models/chat-models/llama-3-1-8b.groq.ts","../src/provider/provider.groq.ts"],"names":["BaseChatModelOptions","z","BaseChatModelGroq","BaseChatModel","modelSchema","options","parsedOptions","baseUrl","Groq","messages","transformedMessages","message","content","temperature","RangeConfigItem","CHAT_CONFIG","maxTokens","maxOutputTokens","stop","MultiStringConfigItem","topP","frequencyPenalty","presencePenalty","seed","responseFormat","SelectStringConfigItem","toolChoice","ChatModelBaseConfigSchema","value","ChatModelBaseConfigDef","GroqChatModelConfigs","Gemma_7b_ITLiteral","Gemma_7b_ITDescription","Gemma_7b_ITSchema","ChatModelSchema","OpenAIChatModelRoles","OpenAIChatModelTextToolModalitiesEnum","OpenAIChatModelRolesMap","OpenAIChatModelTextToolModalities","Gemma_7b_ITOptions","Gemma_7b_IT","Gemma2_9b_ITLiteral","Gemma2_9b_ITDescription","Gemma2_9b_ITSchema","Gemma2_9b_ITOptions","Gemma2_9b_IT","Mixtral_8x7bLiteral","Mixtral_8x7bDescription","Mixtral_8x7bSchema","Mixtral_8x7bOptions","Mixtral_8x7b","LlamaGuard_3_8bLiteral","LlamaGuard_3_8bDescription","LlamaGuard_3_8bSchema","LlamaGuard_3_8bOptions","LlamaGuard_3_8b","Llama_3_8bLiteral","Llama_3_8bDescription","Llama_3_8bSchema","Llama_3_8bOptions","Llama_3_8b","Llama_3_70bLiteral","Llama_3_70bDescription","Llama_3_70bSchema","Llama_3_70bOptions","Llama_3_70b","Llama_3_70b_Tool_UseLiteral","Llama_3_70b_Tool_UseDescription","Llama_3_70b_Tool_UseSchema","Llama_3_70b_Tool_Use_Options","Llama_3_70b_Tool_Use","Llama_3_8b_Tool_UseLiteral","Llama_3_8b_Tool_UseDescription","Llama_3_8b_Tool_UseSchema","Llama_3_8b_Tool_Use_Options","Llama_3_8b_Tool_Use","Llama_3_2_11b_VisionLiteral","Llama_3_2_11b_VisionDescription","Llama_3_2_11b_VisionSchema","OpenAIChatModelModalitiesEnum","OpenAIChatModelModalities","Llama_3_2_11b_VisionOptions","Llama_3_2_11b_Vision","Llama_3_2_3bLiteral","Llama_3_2_3bDescription","Llama_3_2_3bSchema","Llama_3_2_3b_Options","Llama_3_2_3b","Llama_3_2_1bLiteral","Llama_3_2_1bDescription","Llama_3_2_1bSchema","Llama_3_2_1b_Options","Llama_3_2_1b","Llama_3_1_70bLiteral","Llama_3_1_70bDescription","Llama_3_1_70bSchema","Llama_3_1_70b_Options","Llama_3_1_70b","Llama_3_1_8bLiteral","Llama_3_1_8bDescription","Llama_3_1_8bSchema","Llama_3_1_8b_Options","Llama_3_1_8b","ProviderLiteral","acc","key","modelName","ProviderError","model"],"mappings":";;;;AAQMA,IAAAA,CAAAA,CAAuBC,IAAE,MAAO,CAAA,CACpC,SAAWA,CAAAA,GAAAA,CAAE,MAAO,EAAA,CAAE,GAAI,CAAA,CAAC,CAC3B,CAAA,MAAA,CAAQA,GAAE,CAAA,MAAA,EAAS,CAAA,GAAA,CAAI,CAAC,CAC1B,CAAC,CAGKC,CAAAA,CAAAA,CAAN,cAAgCC,aAAc,CAO5C,WAAA,CAAYC,CAAkCC,CAAAA,CAAAA,CAAmC,CAC/E,IAAMC,CAAgBN,CAAAA,CAAAA,CAAqB,MAAMK,CAAO,CAAA,CAClDE,CAAUC,CAAAA,CAAAA,CAAK,OACrB,CAAA,KAAA,CAAMJ,CAAa,CAAA,CACjB,SAAWE,CAAAA,CAAAA,CAAc,SACzB,CAAA,MAAA,CAAQA,CAAc,CAAA,MAAA,CACtB,QAASC,CACT,CAAA,eAAA,CAAiB,CAAGA,EAAAA,CAAO,CAC3B,iBAAA,CAAA,CAAA,aAAA,CAAe,CAAGA,EAAAA,CAAO,CAC3B,iBAAA,CAAA,CAAC,CAfH,CAAA,IAAA,CAAS,OAAU,CAAA,IAAA,CAgBjB,KAAK,WAAcH,CAAAA,CAAAA,CACnB,IAAK,CAAA,SAAA,CAAYE,CAAc,CAAA,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EAAgB,IAAK,CAAA,kBAAA,CAAmBoG,CAAS,CAAA,CAAE,aAAa,KAAMrG,CAAAA,CAAO,EACnF,OAAO,IAAIuG,EAAMtG,CAAa,CAChC,CAEA,sBAAA,EAAmC,CACjC,OAAO,MAAA,CAAO,KAAK,IAAK,CAAA,uBAAuB,CACjD,CAEA,qBAAA,EAAkE,CAChE,OAAO,OAAO,IAAK,CAAA,IAAA,CAAK,uBAAuB,CAAE,CAAA,MAAA,CAC/C,CAACkG,CAAKC,CAAAA,CAAAA,IACJD,CAAIC,CAAAA,CAAG,EAAI,IAAK,CAAA,uBAAA,CAAwBA,CAAG,CAAE,CAAA,WAAA,CACtCD,GAET,EACF,CACF,CAGA,eAAenG,CAA8B,CAAA,CAC3C,MAAM,IAAIsG,aAAAA,CAAc,CACtB,IAAM,CAAA,4CAAA,CACN,MAAO,IAAI,KAAA,CAAM,4CAA4C,CAC/D,CAAC,CACH,CACF,EA3IMnG,EAGY,OAAU,CAAA,gCAAA","file":"index.mjs","sourcesContent":["import { z } from \"zod\";\n\nimport { BaseChatModel, OpenAIChatRequestMessageType } from \"@adaline/openai\";\nimport { ChatModelSchemaType, ParamsType } from \"@adaline/provider\";\nimport { MessageType } from \"@adaline/types\";\n\nimport { Groq } from \"../../provider\";\n\nconst BaseChatModelOptions = z.object({\n modelName: z.string().min(1),\n apiKey: z.string().min(1),\n});\ntype BaseChatModelOptionsType = z.infer<typeof BaseChatModelOptions>;\n\nclass BaseChatModelGroq extends BaseChatModel {\n readonly version = \"v1\" as const;\n modelSchema: ChatModelSchemaType;\n readonly modelName: string;\n\n private readonly groqApiKey: string;\n\n constructor(modelSchema: ChatModelSchemaType, options: BaseChatModelOptionsType) {\n const parsedOptions = BaseChatModelOptions.parse(options);\n const baseUrl = Groq.baseUrl;\n super(modelSchema, {\n modelName: parsedOptions.modelName,\n apiKey: parsedOptions.apiKey,\n baseUrl: baseUrl,\n completeChatUrl: `${baseUrl}/chat/completions`,\n streamChatUrl: `${baseUrl}/chat/completions`,\n });\n this.modelSchema = modelSchema;\n this.modelName = parsedOptions.modelName;\n this.groqApiKey = parsedOptions.apiKey;\n }\n\n transformMessages(messages: MessageType[]): ParamsType {\n const transformedMessages = super.transformMessages(messages) as { messages: OpenAIChatRequestMessageType[] };\n\n // Groq expects the content to be a string for system and assistant messages\n // OpenAI transformer takes care of validating role and modality\n transformedMessages.messages.forEach((message) => {\n if (message.role === \"system\") {\n if (typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n } else if (message.role === \"assistant\") {\n if (message.content && typeof message.content !== \"string\") {\n message.content = message.content.map((content) => content.text).join(\"\\n\");\n }\n }\n });\n\n return transformedMessages;\n }\n\n // TODO: streamChat needs it's own implementation, OpenAI stream transformer is skipping some chunks\n}\n\nexport { BaseChatModelGroq, BaseChatModelOptions, type BaseChatModelOptionsType };\n","import { CHAT_CONFIG, MultiStringConfigItem, RangeConfigItem, SelectStringConfigItem } from \"@adaline/provider\";\n\nconst temperature = RangeConfigItem({\n param: \"temperature\",\n title: CHAT_CONFIG.TEMPERATURE.title,\n description: CHAT_CONFIG.TEMPERATURE.description,\n min: 0,\n max: 2,\n step: 0.01,\n default: 1,\n});\n\nconst maxTokens = (maxOutputTokens: number) =>\n RangeConfigItem({\n param: \"max_tokens\",\n title: CHAT_CONFIG.MAX_TOKENS.title,\n description: CHAT_CONFIG.MAX_TOKENS.description,\n min: 0,\n max: maxOutputTokens,\n step: 1,\n default: 0,\n });\n\nconst stop = MultiStringConfigItem({\n param: \"stop\",\n title: CHAT_CONFIG.STOP(4).title,\n description: CHAT_CONFIG.STOP(4).description,\n max: 4,\n});\n\nconst topP = RangeConfigItem({\n param: \"top_p\",\n title: CHAT_CONFIG.TOP_P.title,\n description: CHAT_CONFIG.TOP_P.description,\n min: 0,\n max: 1,\n step: 0.01,\n default: 1,\n});\n\nconst frequencyPenalty = RangeConfigItem({\n param: \"frequency_penalty\",\n title: CHAT_CONFIG.FREQUENCY_PENALTY.title,\n description: CHAT_CONFIG.FREQUENCY_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst presencePenalty = RangeConfigItem({\n param: \"presence_penalty\",\n title: CHAT_CONFIG.PRESENCE_PENALTY.title,\n description: CHAT_CONFIG.PRESENCE_PENALTY.description,\n min: -2,\n max: 2,\n step: 0.01,\n default: 0,\n});\n\nconst seed = RangeConfigItem({\n param: \"seed\",\n title: CHAT_CONFIG.SEED.title,\n description: CHAT_CONFIG.SEED.description,\n min: 0,\n max: 1000000,\n step: 1,\n default: 0,\n});\n\nconst responseFormat = SelectStringConfigItem({\n param: \"response_format\",\n title: CHAT_CONFIG.RESPONSE_FORMAT.title,\n description: CHAT_CONFIG.RESPONSE_FORMAT.description,\n default: \"text\",\n choices: [\"text\", \"json_object\"],\n});\n\nconst toolChoice = SelectStringConfigItem({\n param: \"tool_choice\",\n title: \"Tool choice\",\n description:\n \"Controls which (if any) tool is called by the model. \\\n 'none' means the model will not call a function. \\\n 'auto' means the model can pick between generating a message or calling a tool.\",\n default: \"auto\",\n choices: [\"auto\", \"required\", \"none\"],\n});\n\nexport { frequencyPenalty, maxTokens, presencePenalty, seed, stop, temperature, toolChoice, topP, responseFormat };\n","import { z } from \"zod\";\n\nimport {\n frequencyPenalty,\n maxTokens,\n presencePenalty,\n responseFormat,\n seed,\n stop,\n temperature,\n toolChoice,\n topP,\n} from \"./common.config.chat-model.groq\";\n\nconst ChatModelBaseConfigSchema = (maxOutputTokens: number) =>\n z.object({\n temperature: temperature.schema,\n maxTokens: maxTokens(maxOutputTokens).schema,\n stop: stop.schema,\n topP: topP.schema,\n frequencyPenalty: frequencyPenalty.schema,\n presencePenalty: presencePenalty.schema,\n seed: seed.schema.transform((value) => (value === 0 ? undefined : value)),\n responseFormat: responseFormat.schema,\n toolChoice: toolChoice.schema,\n });\n\nconst ChatModelBaseConfigDef = (maxOutputTokens: number) =>\n ({\n temperature: temperature.def,\n maxTokens: maxTokens(maxOutputTokens).def,\n stop: stop.def,\n topP: topP.def,\n frequencyPenalty: frequencyPenalty.def,\n presencePenalty: presencePenalty.def,\n seed: seed.def,\n responseFormat: responseFormat.def,\n toolChoice: toolChoice.def,\n }) as const;\n\nexport { ChatModelBaseConfigDef, ChatModelBaseConfigSchema };\n","import { ChatModelBaseConfigDef, ChatModelBaseConfigSchema } from \"./chat-model\";\n\nconst GroqChatModelConfigs = {\n base: (maxOutputTokens: number) => ({\n def: ChatModelBaseConfigDef(maxOutputTokens),\n schema: ChatModelBaseConfigSchema(maxOutputTokens),\n }),\n} as const;\n\nexport { GroqChatModelConfigs };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma_7b_ITLiteral = \"gemma-7b-it\" as const;\n// https://huggingface.co/google/gemma-1.1-7b-it\nconst Gemma_7b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma_7b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma_7b_ITLiteral,\n description: Gemma_7b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma_7b_ITOptions = BaseChatModelOptions;\ntype Gemma_7b_ITOptionsType = z.infer<typeof Gemma_7b_ITOptions>;\n\nclass Gemma_7b_IT extends BaseChatModelGroq {\n constructor(options: Gemma_7b_ITOptionsType) {\n super(Gemma_7b_ITSchema, options);\n }\n}\n\nexport { Gemma_7b_IT, Gemma_7b_ITOptions, Gemma_7b_ITSchema, Gemma_7b_ITLiteral, type Gemma_7b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Gemma2_9b_ITLiteral = \"gemma2-9b-it\" as const;\n// https://huggingface.co/google/gemma-2-9b-it\nconst Gemma2_9b_ITDescription =\n \"Gemma is a family of lightweight, state-of-the-art open models from Google, \\\n built from the same research and technology used to create the Gemini models.\";\n\nconst Gemma2_9b_ITSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Gemma2_9b_ITLiteral,\n description: Gemma2_9b_ITDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Gemma2_9b_ITOptions = BaseChatModelOptions;\ntype Gemma2_9b_ITOptionsType = z.infer<typeof Gemma2_9b_ITOptions>;\n\nclass Gemma2_9b_IT extends BaseChatModelGroq {\n constructor(options: Gemma2_9b_ITOptionsType) {\n super(Gemma2_9b_ITSchema, options);\n }\n}\n\nexport { Gemma2_9b_IT, Gemma2_9b_ITOptions, Gemma2_9b_ITSchema, Gemma2_9b_ITLiteral, type Gemma2_9b_ITOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Mixtral_8x7bLiteral = \"mixtral-8x7b-32768\" as const;\n// https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1\nconst Mixtral_8x7bDescription = \"The Mixtral-8x7B Large Language Model (LLM) is a pretrained generative Sparse Mixture of Experts.\";\n\nconst Mixtral_8x7bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Mixtral_8x7bLiteral,\n description: Mixtral_8x7bDescription,\n maxInputTokens: 32768,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Mixtral_8x7bOptions = BaseChatModelOptions;\ntype Mixtral_8x7bOptionsType = z.infer<typeof Mixtral_8x7bOptions>;\n\nclass Mixtral_8x7b extends BaseChatModelGroq {\n constructor(options: Mixtral_8x7bOptionsType) {\n super(Mixtral_8x7bSchema, options);\n }\n}\n\nexport { Mixtral_8x7b, Mixtral_8x7bOptions, Mixtral_8x7bSchema, Mixtral_8x7bLiteral, type Mixtral_8x7bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst LlamaGuard_3_8bLiteral = \"llama-guard-3-8b\" as const;\n// https://huggingface.co/meta-llama/Llama-Guard-3-8B\nconst LlamaGuard_3_8bDescription = \"Llama Guard 3 is a Llama-3.1-8B pretrained model, fine-tuned for content safety classification.\";\n\nconst LlamaGuard_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: LlamaGuard_3_8bLiteral,\n description: LlamaGuard_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst LlamaGuard_3_8bOptions = BaseChatModelOptions;\ntype LlamaGuard_3_8bOptionsType = z.infer<typeof LlamaGuard_3_8bOptions>;\n\nclass LlamaGuard_3_8b extends BaseChatModelGroq {\n constructor(options: LlamaGuard_3_8bOptionsType) {\n super(LlamaGuard_3_8bSchema, options);\n }\n}\n\nexport { LlamaGuard_3_8b, LlamaGuard_3_8bOptions, LlamaGuard_3_8bSchema, LlamaGuard_3_8bLiteral, type LlamaGuard_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8bLiteral = \"llama3-8b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct\nconst Llama_3_8bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8bLiteral,\n description: Llama_3_8bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8bOptions = BaseChatModelOptions;\ntype Llama_3_8bOptionsType = z.infer<typeof Llama_3_8bOptions>;\n\nclass Llama_3_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_8bOptionsType) {\n super(Llama_3_8bSchema, options);\n }\n}\n\nexport { Llama_3_8b, Llama_3_8bOptions, Llama_3_8bSchema, Llama_3_8bLiteral, type Llama_3_8bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70bLiteral = \"llama3-70b-8192\" as const;\n// https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct\nconst Llama_3_70bDescription =\n \"The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of \\\n the available open source chat models on common industry benchmarks.\";\n\nconst Llama_3_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70bLiteral,\n description: Llama_3_70bDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70bOptions = BaseChatModelOptions;\ntype Llama_3_70bOptionsType = z.infer<typeof Llama_3_70bOptions>;\n\nclass Llama_3_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_70bOptionsType) {\n super(Llama_3_70bSchema, options);\n }\n}\n\nexport { Llama_3_70b, Llama_3_70bOptions, Llama_3_70bSchema, Llama_3_70bLiteral, type Llama_3_70bOptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_70b_Tool_UseLiteral = \"llama3-groq-70b-8192-tool-use-preview\" as const;\n// https://huggingface.co/Groq/Llama-3-Groq-70B-Tool-Use\nconst Llama_3_70b_Tool_UseDescription =\n \"This is the 70B parameter version of the Llama 3 Groq Tool Use model, \\\n specifically designed for advanced tool use and function calling tasks.\";\n\nconst Llama_3_70b_Tool_UseSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_70b_Tool_UseLiteral,\n description: Llama_3_70b_Tool_UseDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_70b_Tool_Use_Options = BaseChatModelOptions;\ntype Llama_3_70b_Tool_Use_OptionsType = z.infer<typeof Llama_3_70b_Tool_Use_Options>;\n\nclass Llama_3_70b_Tool_Use extends BaseChatModelGroq {\n constructor(options: Llama_3_70b_Tool_Use_OptionsType) {\n super(Llama_3_70b_Tool_UseSchema, options);\n }\n}\n\nexport {\n Llama_3_70b_Tool_Use,\n Llama_3_70b_Tool_Use_Options,\n Llama_3_70b_Tool_UseSchema,\n Llama_3_70b_Tool_UseLiteral,\n type Llama_3_70b_Tool_Use_OptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_8b_Tool_UseLiteral = \"llama3-groq-8b-8192-tool-use-preview\" as const;\n// https://huggingface.co/Groq/Llama-3-Groq-8B-Tool-Use\nconst Llama_3_8b_Tool_UseDescription =\n \"This is the 8B parameter version of the Llama 3 Groq Tool Use model, \\\n specifically designed for advanced tool use and function calling tasks.\";\n\nconst Llama_3_8b_Tool_UseSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_8b_Tool_UseLiteral,\n description: Llama_3_8b_Tool_UseDescription,\n maxInputTokens: 8192,\n maxOutputTokens: 4096,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(4096).def,\n schema: GroqChatModelConfigs.base(4096).schema,\n },\n});\n\nconst Llama_3_8b_Tool_Use_Options = BaseChatModelOptions;\ntype Llama_3_8b_Tool_Use_OptionsType = z.infer<typeof Llama_3_8b_Tool_Use_Options>;\n\nclass Llama_3_8b_Tool_Use extends BaseChatModelGroq {\n constructor(options: Llama_3_8b_Tool_Use_OptionsType) {\n super(Llama_3_8b_Tool_UseSchema, options);\n }\n}\n\nexport {\n Llama_3_8b_Tool_Use,\n Llama_3_8b_Tool_Use_Options,\n Llama_3_8b_Tool_UseSchema,\n Llama_3_8b_Tool_UseLiteral,\n type Llama_3_8b_Tool_Use_OptionsType,\n};\n","import { z } from \"zod\";\n\nimport { OpenAIChatModelModalities, OpenAIChatModelModalitiesEnum, OpenAIChatModelRoles, OpenAIChatModelRolesMap } from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_11b_VisionLiteral = \"llama-3.2-11b-vision-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-11B-Vision\nconst Llama_3_2_11b_VisionDescription =\n \"The Llama 3.2-Vision instruction-tuned models are optimized for visual recognition, image reasoning, captioning, \\\n and answering general questions about an image. \\\n The models outperform many of the available open source and closed multimodal models on common industry benchmarks.\";\n\nconst Llama_3_2_11b_VisionSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelModalitiesEnum).parse({\n name: Llama_3_2_11b_VisionLiteral,\n description: Llama_3_2_11b_VisionDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_11b_VisionOptions = BaseChatModelOptions;\ntype Llama_3_2_11b_VisionOptionsType = z.infer<typeof Llama_3_2_11b_VisionOptions>;\n\nclass Llama_3_2_11b_Vision extends BaseChatModelGroq {\n constructor(options: Llama_3_2_11b_VisionOptionsType) {\n super(Llama_3_2_11b_VisionSchema, options);\n }\n}\n\nexport {\n Llama_3_2_11b_Vision,\n Llama_3_2_11b_VisionOptions,\n Llama_3_2_11b_VisionSchema,\n Llama_3_2_11b_VisionLiteral,\n type Llama_3_2_11b_VisionOptionsType,\n};\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_3bLiteral = \"llama-3.2-3b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-3B\nconst Llama_3_2_3bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_3bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_3bLiteral,\n description: Llama_3_2_3bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_3b_Options = BaseChatModelOptions;\ntype Llama_3_2_3b_OptionsType = z.infer<typeof Llama_3_2_3b_Options>;\n\nclass Llama_3_2_3b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_3b_OptionsType) {\n super(Llama_3_2_3bSchema, options);\n }\n}\n\nexport { Llama_3_2_3b, Llama_3_2_3b_Options, Llama_3_2_3bSchema, Llama_3_2_3bLiteral, type Llama_3_2_3b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_2_1bLiteral = \"llama-3.2-1b-preview\" as const;\n// https://huggingface.co/meta-llama/Llama-3.2-1B\nconst Llama_3_2_1bDescription =\n \"The Llama 3.2 instruction-tuned text only models are optimized for multilingual dialogue use cases, including agentic retrieval and \\\n summarization tasks. They outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_2_1bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_2_1bLiteral,\n description: Llama_3_2_1bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_2_1b_Options = BaseChatModelOptions;\ntype Llama_3_2_1b_OptionsType = z.infer<typeof Llama_3_2_1b_Options>;\n\nclass Llama_3_2_1b extends BaseChatModelGroq {\n constructor(options: Llama_3_2_1b_OptionsType) {\n super(Llama_3_2_1bSchema, options);\n }\n}\n\nexport { Llama_3_2_1b, Llama_3_2_1b_Options, Llama_3_2_1bSchema, Llama_3_2_1bLiteral, type Llama_3_2_1b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_70bLiteral = \"llama-3.1-70b-versatile\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_70bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_70bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_70bLiteral,\n description: Llama_3_1_70bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_70b_Options = BaseChatModelOptions;\ntype Llama_3_1_70b_OptionsType = z.infer<typeof Llama_3_1_70b_Options>;\n\nclass Llama_3_1_70b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_70b_OptionsType) {\n super(Llama_3_1_70bSchema, options);\n }\n}\n\nexport { Llama_3_1_70b, Llama_3_1_70b_Options, Llama_3_1_70bSchema, Llama_3_1_70bLiteral, type Llama_3_1_70b_OptionsType };\n","import { z } from \"zod\";\n\nimport {\n OpenAIChatModelRoles,\n OpenAIChatModelRolesMap,\n OpenAIChatModelTextToolModalities,\n OpenAIChatModelTextToolModalitiesEnum,\n} from \"@adaline/openai\";\nimport { ChatModelSchema } from \"@adaline/provider\";\n\nimport { GroqChatModelConfigs } from \"../../configs\";\nimport { BaseChatModelGroq, BaseChatModelOptions } from \"./base-chat-model.groq\";\n\nconst Llama_3_1_8bLiteral = \"llama-3.1-8b-instant\" as const;\n// https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md\nconst Llama_3_1_8bDescription =\n \"The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and \\\n outperform many of the available open source and closed chat models on common industry benchmarks.\";\n\nconst Llama_3_1_8bSchema = ChatModelSchema(OpenAIChatModelRoles, OpenAIChatModelTextToolModalitiesEnum).parse({\n name: Llama_3_1_8bLiteral,\n description: Llama_3_1_8bDescription,\n maxInputTokens: 128000,\n maxOutputTokens: 8192,\n roles: OpenAIChatModelRolesMap,\n modalities: OpenAIChatModelTextToolModalities,\n config: {\n def: GroqChatModelConfigs.base(8192).def,\n schema: GroqChatModelConfigs.base(8192).schema,\n },\n});\n\nconst Llama_3_1_8b_Options = BaseChatModelOptions;\ntype Llama_3_1_8b_OptionsType = z.infer<typeof Llama_3_1_8b_Options>;\n\nclass Llama_3_1_8b extends BaseChatModelGroq {\n constructor(options: Llama_3_1_8b_OptionsType) {\n super(Llama_3_1_8bSchema, options);\n }\n}\n\nexport { Llama_3_1_8b, Llama_3_1_8b_Options, Llama_3_1_8bSchema, Llama_3_1_8bLiteral, type Llama_3_1_8b_OptionsType };\n","import { z } from \"zod\";\n\nimport { ChatModelSchemaType, ChatModelV1, EmbeddingModelSchemaType, EmbeddingModelV1, ProviderError, ProviderV1 } from \"@adaline/provider\";\n\nimport * as Models from \"../models\";\n\nconst ProviderLiteral = \"groq\";\nclass Groq<C extends Models.BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {\n readonly version = \"v1\" as const;\n readonly name = ProviderLiteral;\n static readonly baseUrl = \"https://api.groq.com/openai/v1\";\n\n private readonly chatModelFactories: Record<\n string,\n {\n model: { new (options: any): ChatModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: ChatModelSchemaType;\n }\n > = {\n [Models.Gemma_7b_ITLiteral]: {\n model: Models.Gemma_7b_IT,\n modelOptions: Models.Gemma_7b_ITOptions,\n modelSchema: Models.Gemma_7b_ITSchema,\n },\n [Models.Gemma2_9b_ITLiteral]: {\n model: Models.Gemma2_9b_IT,\n modelOptions: Models.Gemma2_9b_ITOptions,\n modelSchema: Models.Gemma2_9b_ITSchema,\n },\n [Models.LlamaGuard_3_8bLiteral]: {\n model: Models.LlamaGuard_3_8b,\n modelOptions: Models.LlamaGuard_3_8bOptions,\n modelSchema: Models.LlamaGuard_3_8bSchema,\n },\n [Models.Llama_3_8bLiteral]: {\n model: Models.Llama_3_8b,\n modelOptions: Models.Llama_3_8bOptions,\n modelSchema: Models.Llama_3_8bSchema,\n },\n [Models.Llama_3_70bLiteral]: {\n model: Models.Llama_3_70b,\n modelOptions: Models.Llama_3_70bOptions,\n modelSchema: Models.Llama_3_70bSchema,\n },\n [Models.Llama_3_1_8bLiteral]: {\n model: Models.Llama_3_1_8b,\n modelOptions: Models.Llama_3_1_8b_Options,\n modelSchema: Models.Llama_3_1_8bSchema,\n },\n [Models.Llama_3_8b_Tool_UseLiteral]: {\n model: Models.Llama_3_8b_Tool_Use,\n modelOptions: Models.Llama_3_8b_Tool_Use_Options,\n modelSchema: Models.Llama_3_8b_Tool_UseSchema,\n },\n [Models.Llama_3_1_70bLiteral]: {\n model: Models.Llama_3_1_70b,\n modelOptions: Models.Llama_3_1_70b_Options,\n modelSchema: Models.Llama_3_1_70bSchema,\n },\n [Models.Llama_3_70b_Tool_UseLiteral]: {\n model: Models.Llama_3_70b_Tool_Use,\n modelOptions: Models.Llama_3_70b_Tool_Use_Options,\n modelSchema: Models.Llama_3_70b_Tool_UseSchema,\n },\n [Models.Llama_3_2_11b_VisionLiteral]: {\n model: Models.Llama_3_2_11b_Vision,\n modelOptions: Models.Llama_3_2_11b_VisionOptions,\n modelSchema: Models.Llama_3_2_11b_VisionSchema,\n },\n [Models.Llama_3_2_3bLiteral]: {\n model: Models.Llama_3_2_3b,\n modelOptions: Models.Llama_3_2_3b_Options,\n modelSchema: Models.Llama_3_2_3bSchema,\n },\n [Models.Llama_3_2_1bLiteral]: {\n model: Models.Llama_3_2_1b,\n modelOptions: Models.Llama_3_2_1b_Options,\n modelSchema: Models.Llama_3_2_1bSchema,\n },\n [Models.Mixtral_8x7bLiteral]: {\n model: Models.Mixtral_8x7b,\n modelOptions: Models.Mixtral_8x7bOptions,\n modelSchema: Models.Mixtral_8x7bSchema,\n },\n };\n\n private readonly embeddingModelFactories: Record<\n string,\n {\n model: { new (options: any): EmbeddingModelV1 };\n modelOptions: z.ZodType<any>;\n modelSchema: EmbeddingModelSchemaType;\n }\n > = {};\n\n chatModelLiterals(): string[] {\n return Object.keys(this.chatModelFactories);\n }\n\n chatModelSchemas(): Record<string, ChatModelSchemaType> {\n return Object.keys(this.chatModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.chatModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, ChatModelSchemaType>\n );\n }\n\n chatModel(options: C): ChatModelV1 {\n const modelName = options.modelName;\n if (!(modelName in this.chatModelFactories)) {\n throw new ProviderError({\n info: `Groq chat model: ${modelName} not found`,\n cause: new Error(`Groq chat model: ${modelName} not found, available chat models: \n ${this.chatModelLiterals().join(\", \")}`),\n });\n }\n\n const model = this.chatModelFactories[modelName].model;\n const parsedOptions = this.chatModelFactories[modelName].modelOptions.parse(options);\n return new model(parsedOptions);\n }\n\n embeddingModelLiterals(): string[] {\n return Object.keys(this.embeddingModelFactories);\n }\n\n embeddingModelSchemas(): Record<string, EmbeddingModelSchemaType> {\n return Object.keys(this.embeddingModelFactories).reduce(\n (acc, key) => {\n acc[key] = this.embeddingModelFactories[key].modelSchema;\n return acc;\n },\n {} as Record<string, EmbeddingModelSchemaType>\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n embeddingModel(options: E): EmbeddingModelV1 {\n throw new ProviderError({\n info: \"Groq does not support embedding models yet\",\n cause: new Error(\"Groq does not support embedding models yet\"),\n });\n }\n}\n\nexport { Groq };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaline/groq",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"private": false,
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"zod": "^3.23.8",
|
|
49
|
-
"@adaline/provider": "0.
|
|
50
|
-
"@adaline/types": "0.
|
|
51
|
-
"@adaline/openai": "0.
|
|
49
|
+
"@adaline/provider": "0.16.0",
|
|
50
|
+
"@adaline/types": "0.14.0",
|
|
51
|
+
"@adaline/openai": "0.19.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@adaline/tsconfig": "0.
|
|
55
|
-
"eslint-config-adaline": "0.
|
|
54
|
+
"@adaline/tsconfig": "0.10.0",
|
|
55
|
+
"eslint-config-adaline": "0.7.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"clean": "rimraf node_modules .turbo dist",
|