Skip to content

Dynamic config.json #1780

Answered by corinagum
mpriem asked this question in Q&A
Jun 27, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

The planner defaultPrompt can be a function and therefore dynamically set the config like so:

defaultPrompt: async () => {
const prompt = await prompts.getPrompt('chat');
prompt.config.completion.model = 'gpt-4o';
if (process.env.AZURE_SEARCH_ENDPOINT) {
(prompt.config.completion as any).data_sources = [{
type: 'azure_search',
parameters: {
endpoint: process.env.AZURE_SEARCH_ENDPOINT,
index_name: process.env.AZURE_SEARCH_INDEX,
semantic_configuration: 'default',
query_type: 'simple',
fields_mapping: { },
in_scope: true,

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mpriem
Comment options

@corinagum
Comment options

Answer selected by corinagum
@mpriem
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
dev support Dev support tracking support answered completed items previously under dev support label
2 participants