Skip to content

Commit 4e8afb8

Browse files
ci: apply automated fixes
1 parent fd0ad2c commit 4e8afb8

14 files changed

Lines changed: 63 additions & 65 deletions

codemods/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Each codemod lives in its own subdirectory and is named after the migration it c
66

77
## Available codemods
88

9-
| Codemod | Migrates |
10-
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11-
| [`ag-ui-compliance`](./ag-ui-compliance) | Client-side renames introduced by the AG-UI client/server compliance release: `body``forwardedProps` on `useChat` / `ChatClient` / `updateOptions`, Svelte's `updateBody``updateForwardedProps`, and `chat({ conversationId })``chat({ threadId })`. |
12-
| [`move-sampling-to-model-options`](./move-sampling-to-model-options) | Moves root `temperature` / `topP` / `maxTokens` off `chat()` / `ai()` / `generate()` / `createChatOptions()` into provider-native `modelOptions`, renamed per provider (with ollama nesting under `options`). |
9+
| Codemod | Migrates |
10+
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11+
| [`ag-ui-compliance`](./ag-ui-compliance) | Client-side renames introduced by the AG-UI client/server compliance release: `body``forwardedProps` on `useChat` / `ChatClient` / `updateOptions`, Svelte's `updateBody``updateForwardedProps`, and `chat({ conversationId })``chat({ threadId })`. |
12+
| [`move-sampling-to-model-options`](./move-sampling-to-model-options) | Moves root `temperature` / `topP` / `maxTokens` off `chat()` / `ai()` / `generate()` / `createChatOptions()` into provider-native `modelOptions`, renamed per provider (with ollama nesting under `options`). |
1313

1414
## Running a codemod
1515

codemods/move-sampling-to-model-options/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ The provider is resolved from the `adapter:` property's factory call (e.g.
1515
`openaiText('gpt-4o')``openai`). Each present root prop is moved into
1616
`modelOptions` under its provider-specific name:
1717

18-
| Root prop | openai | anthropic | gemini | grok | groq | openrouter | ollama (nested) |
19-
| ------------- | ------------------- | ------------ | ----------------- | ------------ | ----------------------- | --------------------- | ---------------------- |
20-
| `temperature` | `temperature` | `temperature`| `temperature` | `temperature`| `temperature` | `temperature` | `options.temperature` |
21-
| `topP` | `top_p` | `top_p` | `topP` | `top_p` | `top_p` | `topP` | `options.top_p` |
22-
| `maxTokens` | `max_output_tokens` | `max_tokens` | `maxOutputTokens` | `max_tokens` | `max_completion_tokens` | `maxCompletionTokens` | `options.num_predict` |
18+
| Root prop | openai | anthropic | gemini | grok | groq | openrouter | ollama (nested) |
19+
| ------------- | ------------------- | ------------- | ----------------- | ------------- | ----------------------- | --------------------- | --------------------- |
20+
| `temperature` | `temperature` | `temperature` | `temperature` | `temperature` | `temperature` | `temperature` | `options.temperature` |
21+
| `topP` | `top_p` | `top_p` | `topP` | `top_p` | `top_p` | `topP` | `options.top_p` |
22+
| `maxTokens` | `max_output_tokens` | `max_tokens` | `maxOutputTokens` | `max_tokens` | `max_completion_tokens` | `maxCompletionTokens` | `options.num_predict` |
2323

2424
For **ollama**, the renamed keys are nested inside a `options` object **within**
2525
`modelOptions` (e.g. `modelOptions: { options: { temperature, num_predict } }`).

codemods/move-sampling-to-model-options/__testfixtures__/anthropic-merge.output.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function run(messages: Array<unknown>) {
99

1010
modelOptions: {
1111
top_k: 40,
12-
temperature: temperature
13-
}
14-
});
12+
temperature: temperature,
13+
},
14+
})
1515
}

codemods/move-sampling-to-model-options/__testfixtures__/create-chat-options.output.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export const options = createChatOptions({
66

77
modelOptions: {
88
temperature: 0.2,
9-
top_p: 0.8
10-
}
9+
top_p: 0.8,
10+
},
1111
})

codemods/move-sampling-to-model-options/__testfixtures__/gemini-rename.output.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function run(messages: Array<unknown>) {
88

99
modelOptions: {
1010
topP: 0.9,
11-
maxOutputTokens: 512
12-
}
13-
});
11+
maxOutputTokens: 512,
12+
},
13+
})
1414
}

codemods/move-sampling-to-model-options/__testfixtures__/generate-and-ai.output.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export function viaAi(messages: Array<unknown>) {
77
messages,
88

99
modelOptions: {
10-
max_tokens: 64
11-
}
12-
});
10+
max_tokens: 64,
11+
},
12+
})
1313
}
1414

1515
export function viaGenerate(messages: Array<unknown>) {
@@ -18,7 +18,7 @@ export function viaGenerate(messages: Array<unknown>) {
1818
messages,
1919

2020
modelOptions: {
21-
top_p: 0.95
22-
}
23-
});
21+
top_p: 0.95,
22+
},
23+
})
2424
}

codemods/move-sampling-to-model-options/__testfixtures__/groq-maxtokens.output.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function run(messages: Array<unknown>) {
77
messages,
88

99
modelOptions: {
10-
max_completion_tokens: 256
11-
}
12-
});
10+
max_completion_tokens: 256,
11+
},
12+
})
1313
}

codemods/move-sampling-to-model-options/__testfixtures__/ollama-nested.output.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export function run(messages: Array<unknown>) {
99
modelOptions: {
1010
options: {
1111
temperature: 0.7,
12-
num_predict: 200
13-
}
14-
}
15-
});
12+
num_predict: 200,
13+
},
14+
},
15+
})
1616
}

codemods/move-sampling-to-model-options/__testfixtures__/openai-basic.output.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function run(messages: Array<unknown>) {
88

99
modelOptions: {
1010
temperature: 0.3,
11-
max_output_tokens: 100
12-
}
13-
});
11+
max_output_tokens: 100,
12+
},
13+
})
1414
}

codemods/move-sampling-to-model-options/__testfixtures__/openrouter-maxtokens.output.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function run(messages: Array<unknown>) {
77
messages,
88

99
modelOptions: {
10-
maxCompletionTokens: 1024
11-
}
12-
});
10+
maxCompletionTokens: 1024,
11+
},
12+
})
1313
}

0 commit comments

Comments
 (0)