File tree Expand file tree Collapse file tree
packages/types/src/providers
src/api/providers/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,19 @@ export const xaiModels = {
4848 includedTools : [ "search_replace" ] ,
4949 excludedTools : [ "apply_diff" ] ,
5050 } ,
51+ "grok-build-0.1" : {
52+ maxTokens : 65_536 ,
53+ contextWindow : 256_000 ,
54+ supportsImages : true ,
55+ supportsPromptCache : true ,
56+ inputPrice : 1.0 ,
57+ outputPrice : 2.0 ,
58+ cacheWritesPrice : 0.2 ,
59+ cacheReadsPrice : 0.2 ,
60+ description : "xAI's Grok Build 0.1 agentic coding model with 256K context window" ,
61+ includedTools : [ "search_replace" ] ,
62+ excludedTools : [ "apply_diff" ] ,
63+ } ,
5164 "grok-4-1-fast-reasoning" : {
5265 maxTokens : 65_536 ,
5366 contextWindow : 2_000_000 ,
Original file line number Diff line number Diff line change @@ -69,6 +69,21 @@ describe("XAIHandler", () => {
6969 expect ( model . info ) . toEqual ( xaiModels [ testModelId ] )
7070 } )
7171
72+ it ( "should return grok-build-0.1 when specified" , ( ) => {
73+ const testModelId = "grok-build-0.1"
74+ const handlerWithModel = new XAIHandler ( { apiModelId : testModelId } )
75+ const model = handlerWithModel . getModel ( )
76+ expect ( model . id ) . toBe ( testModelId )
77+ expect ( model . info ) . toEqual ( xaiModels [ testModelId ] )
78+ } )
79+
80+ it ( "should return default model for an unknown model id" , ( ) => {
81+ const handlerWithModel = new XAIHandler ( { apiModelId : "grok-build-0.1-not-a-model" } )
82+ const model = handlerWithModel . getModel ( )
83+ expect ( model . id ) . toBe ( xaiDefaultModelId )
84+ expect ( model . info ) . toEqual ( xaiModels [ xaiDefaultModelId ] )
85+ } )
86+
7287 it ( "should use Responses API (client.responses.create)" , async ( ) => {
7388 mockResponsesCreate . mockResolvedValueOnce ( asyncStreamFrom ( [ ] ) )
7489
You can’t perform that action at this time.
0 commit comments