Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions ts/config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,12 @@ openAI:
# modelProvider: copilot
# copilot:
# defaultModel: gpt-6-luna # requires an authenticated `copilot` CLI
# fallbackModels: # after the matching GPT-5.6 tier, use the first available model
# - gpt-5.4-mini
# - gpt-5-mini
# - gpt-5.4
# # GPT-6/6.1 Luna, Sol, and Terra requests first try the matching GPT-5.6
# # tier when unavailable. This is Copilot model-availability fallback,
# # not retry-on-any-error. Azure routing pools do not switch model families.
# fallbackModels:
# - gpt-6-luna
# # Unavailable GPT-6-family requests fall back only to GPT-6 Luna,
# # regardless of fallbackModels. If Luna is unavailable, the request fails.
# # Explicitly selected, available models are preserved.
# # Azure routing pools do not switch model families.
# # Optional: connect to an already-running Copilot CLI server over TCP
# # instead of spawning a CLI child per host. Eliminates the one-time
# # (multi-second) CLI startup latency. Format: "host:port" / "port".
Expand Down Expand Up @@ -314,8 +313,8 @@ azureAISearch:
# --- Used only by `setup:aisearch` to provision the web KS + KB ---
# Azure OpenAI model the knowledge base uses to summarize web results.
aoaiEndpoint: https://my-openai.openai.azure.com
aoaiDeployment: gpt-4.1-mini
aoaiModel: gpt-4.1-mini
aoaiDeployment: gpt-6-luna
aoaiModel: gpt-6-luna
# aoaiApiKey: <aoai-key> # omit to use managed identity
# webKnowledgeSource: web-lookup-web-ks
# webKnowledgeSourceDomains: learn.microsoft.com,wikipedia.org
Expand Down
58 changes: 15 additions & 43 deletions ts/examples/chat/src/memory/knowproKnowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export type LLMKnowledgeExtractor = {

export type LLMKnowledgeExtractors = {
extractor?: LLMKnowledgeExtractor | undefined;
extractor35?: LLMKnowledgeExtractor | undefined;
extractor41?: LLMKnowledgeExtractor | undefined;
extractor41Mini?: LLMKnowledgeExtractor | undefined;
extractorLuna?: LLMKnowledgeExtractor | undefined;
};

export type KnowProKnowledgeContext = {
Expand Down Expand Up @@ -56,7 +54,7 @@ export async function createKnowproKnowledgeCommands(
description: "Extract knowledge",
options: {
text: arg("Extract from this text OR from this filePath"),
model: arg("Model: 4o | 41 | 41m | 35", "4o"),
model: arg("Model: default | luna", "default"),
v2: argBool("Run version 2", false),
search: argBool("Run knowledge search", false),
},
Expand Down Expand Up @@ -97,7 +95,7 @@ export async function createKnowproKnowledgeCommands(
"Compare inverse actions from v1 and v2 of knowledge extraction",
options: {
text: arg("Extract from this text OR from this filePath"),
model: arg("Model: 4o | 41 | 41m | 35", "4o"),
model: arg("Model: default | luna", "default"),
type: arg("text | podcast", "text"),
},
};
Expand Down Expand Up @@ -215,13 +213,10 @@ export async function createKnowproKnowledgeCommands(
extractor = extractors.extractor;
break;
case "41":
extractor = extractors.extractor41;
break;
case "41m":
extractor = extractors.extractor41Mini;
break;
case "35":
extractor = extractors.extractor35;
case "luna":
extractor = extractors.extractorLuna;
break;
}

Expand Down Expand Up @@ -280,41 +275,18 @@ export async function createKnowproKnowledgeCommands(
),
model: {
model: kpContext.knowledgeModel,
modelName: "4o",
modelName: "default",
},
};
const models41 = kpTest.createGpt41Models();
if (models41.gpt41) {
extractors.extractor41 = {
extractor: kpLib.createKnowledgeExtractor(
models41.gpt41.model,
settings,
translator,
),
model: models41.gpt41,
};
}
if (models41.gpt41Mini) {
extractors.extractor41Mini = {
extractor: kpLib.createKnowledgeExtractor(
models41.gpt41Mini.model,
settings,
translator,
),
model: models41.gpt41Mini,
};
}
const model35 = kpTest.create35Model();
if (model35) {
extractors.extractor35 = {
extractor: kpLib.createKnowledgeExtractor(
model35.model,
settings,
translator,
),
model: model35,
};
}
const luna = kpTest.createLunaModel();
extractors.extractorLuna = {
extractor: kpLib.createKnowledgeExtractor(
luna.model,
settings,
translator,
),
model: luna,
};
return extractors;
}

Expand Down
4 changes: 2 additions & 2 deletions ts/examples/docuProc/src/pdfChunkyIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type NamedIndex = [IndexType, knowLib.TextIndex<string, ChunkId>];
// A bundle of object stores and indexes etc.
export class ChunkyIndex {
chatModel: ChatModel;
miniModel: ChatModel; // E.g. gpt-3.5-turbo or gpt-4-mini or o1-mini.
miniModel: ChatModel;
embeddingModel: TextEmbeddingModel;
fileDocumenter: PdfFileDocumenter;
queryMaker: TypeChatJsonTranslator<QuerySpecs>;
Expand All @@ -44,7 +44,7 @@ export class ChunkyIndex {
private constructor() {
this.chatModel = openai.createJsonChatModel("GPT_6_LUNA", ["DocuProc"]);
this.miniModel = openai.createChatModel(
"GPT_35_TURBO",
"GPT_6_LUNA",
undefined,
undefined,
["DocuProcMini"],
Expand Down
2 changes: 1 addition & 1 deletion ts/examples/docuProc/src/pdfQNAInteractiveApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export async function interactiveAppLoop(
purgeFile,
};

const model = openai.createJsonChatModel("GPT_4", ["PdfDownloader"]);
const model = openai.createJsonChatModel("GPT_6_LUNA", ["PdfDownloader"]);
const pdfDownloader = createPDFDownloadTranslator(model);

const context = await createKnowProContext(captureTokenStats);
Expand Down
8 changes: 4 additions & 4 deletions ts/packages/agents/browser/src/agent/browserActionHandler.mts
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,7 @@ async function executeBrowserActionImpl(
) => {
const agent =
await createDiscoveryPageTranslator(
"GPT_5_2",
"GPT_6_LUNA",
);
const htmlFragments =
await adHocBrowser.getHtmlFragments();
Expand Down Expand Up @@ -2278,7 +2278,7 @@ async function summarizeSearchResults(
context,
);

const model = openai.createJsonChatModel("GPT_35_TURBO", [
const model = openai.createJsonChatModel("GPT_6_LUNA", [
"SearchPageSummary",
]);
hookModelTokenUsage(model);
Expand Down Expand Up @@ -2451,9 +2451,9 @@ async function lookup(
`Generating the answer for '${action.parameters.originalRequest}'`,
context,
);
const model = openai.createJsonChatModel("GPT_35_TURBO", [
const model = openai.createJsonChatModel("GPT_6_LUNA", [
"InternetLookupAnswerGenerator",
]); // TODO: GPT_5_MINI/NANO?
]);
hookModelTokenUsage(model);
const answerResult = await generateAnswer(
action.parameters.originalRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function extractPageComponent(
const apiSettings = ai.azureApiSettingsFromEnv(
ai.ModelType.Chat,
undefined,
"GPT_5_MINI",
ai.GPT_6_LUNA,
);
const model = ai.createChatModel(
apiSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function createModel() {
const apiSettings = ai.azureApiSettingsFromEnv(
ai.ModelType.Chat,
undefined,
"GPT_5_MINI",
ai.GPT_6_LUNA,
);
const model = ai.createChatModel(
apiSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ export async function handleSchemaDiscoveryAction(
}

const browser: BrowserControl = context.agentContext.browserControl;
const agent = await createDiscoveryPageTranslator("GPT_5_2");
const agent = await createDiscoveryPageTranslator("GPT_6_LUNA");

const discoveryContext: DiscoveryActionHandlerContext = {
browser,
Expand Down
4 changes: 2 additions & 2 deletions ts/packages/agents/browser/src/agent/lookup/aiSearchSetup.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
// (auth: identity / DefaultAzureCredential by default; set
// AZURE_AI_SEARCH_API_KEY or AZURE_AI_SEARCH_BEARER_TOKEN to override)
// AZURE_AI_SEARCH_AOAI_ENDPOINT https://<aoai>.openai.azure.com
// AZURE_AI_SEARCH_AOAI_DEPLOYMENT deployment id (e.g. gpt-4.1-mini)
// AZURE_AI_SEARCH_AOAI_MODEL model name (e.g. gpt-4.1-mini)
// AZURE_AI_SEARCH_AOAI_DEPLOYMENT deployment id (e.g. gpt-6-luna)
// AZURE_AI_SEARCH_AOAI_MODEL model name (e.g. gpt-6-luna)
// AZURE_AI_SEARCH_AOAI_API_KEY (optional) Azure OpenAI key; omit to use
// the search service's managed identity
// Optional:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function createExtractComponentFn(
const { createDiscoveryPageTranslator } = await import(
"../discovery/translator.mjs"
);
const agent = await createDiscoveryPageTranslator("GPT_5_2");
const agent = await createDiscoveryPageTranslator("GPT_6_LUNA");
const browser = getBrowserControl(context.agentContext);
const htmlFragments = await browser.getHtmlFragments();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { getBrowserPackageFilePath } from "../utils/packageFilePath.mjs";

const debug = registerDebug("typeagent:browser:webflows:scriptgen");

const SCRIPT_GEN_MODEL = "GPT_5_2";
const SCRIPT_GEN_MODEL = ai.GPT_6_LUNA;

export interface ScriptGenerationOptions {
description?: string;
Expand Down
2 changes: 1 addition & 1 deletion ts/packages/agents/email/src/emailActionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ async function handleEmailAction(
const query = action.parameters.genContent.bodySearchQuery;
if (query) {
const chatModel = openai.createChatModel(
"GPT_35_TURBO",
openai.GPT_6_LUNA,
undefined,
undefined,
["emailActionHandler"],
Expand Down
2 changes: 1 addition & 1 deletion ts/packages/agents/greeting/src/greetingCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class GreetingCommandHandler implements CommandHandler {
apiSettings = openai.localOpenAIApiSettingsFromEnv(
openai.ModelType.Chat,
undefined,
"GPT_35_TURBO",
openai.GPT_6_LUNA,
["greeting"],
);
} else {
Expand Down
10 changes: 10 additions & 0 deletions ts/packages/aiclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ fails rather than falling back to the bare endpoint. Use explicit `azure` to
select that bare endpoint, or an explicit legacy name for compatibility.
Configured non-Azure provider defaults and explicit API settings remain honored.

When configuration synthesizes a bare Azure chat endpoint, it uses only the
named Luna deployment. Other deployments remain available through explicit
selectors but are not automatic chat defaults.

Copilot also defaults to `gpt-6-luna`. An unavailable GPT-6-family request
can fall back only to Luna, ignoring configured fallback lists for that request.
If Luna is missing or disabled, the call fails rather than selecting an older
GPT model or another family. Explicitly requested, available models are still
honored; fallback configuration for other requests remains supported.

Pools are discovered from env-var naming. For a model `GPT_6_LUNA`, aiclient scans:

```
Expand Down
4 changes: 1 addition & 3 deletions ts/packages/aiclient/src/copilotModelDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
export const DEFAULT_COPILOT_MODEL = "gpt-6-luna";

export const DEFAULT_COPILOT_FALLBACK_MODELS: readonly string[] = [
"gpt-5.4-mini",
"gpt-5-mini",
"gpt-5.4",
DEFAULT_COPILOT_MODEL,
];
10 changes: 4 additions & 6 deletions ts/packages/aiclient/src/copilotModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
type ModelRequest,
type ProviderAdapter,
} from "./wireApiProvider/index.js";
import { DEFAULT_COPILOT_MODEL } from "./copilotModelDefaults.js";

const debug = registerDebug("typeagent:aiclient:copilot");
// Per-phase latency breakdown (client start / session create / send / total)
Expand Down Expand Up @@ -536,12 +537,9 @@ export function selectCopilotModel(
const requestedModel = byId.get(requested);
if (requestedModel !== undefined) return requestedModel;

const previousTier = /^gpt-6(?:\.\d+)?-(luna|sol|terra)$/.exec(
requested,
)?.[1];
if (previousTier !== undefined) {
const previousModel = byId.get(`gpt-5.6-${previousTier}`);
if (previousModel !== undefined) return previousModel;
// GPT-6 requests must not silently downgrade or switch away from Luna.
if (/^gpt-6(?:[.-]|$)/i.test(requested)) {
return byId.get(DEFAULT_COPILOT_MODEL);
}

for (const fallback of fallbackModels) {
Expand Down
Loading
Loading