File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
packages/compass-assistant/src Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -280,6 +280,7 @@ export const CompassAssistantProvider = registerCompassPlugin(
280280 initialProps . chat ??
281281 new Chat ( {
282282 transport : new DocsProviderTransport ( {
283+ appName : initialProps . appNameForPrompt ,
283284 instructions : buildConversationInstructionsPrompt ( {
284285 target : initialProps . appNameForPrompt ,
285286 } ) ,
Original file line number Diff line number Diff line change @@ -17,17 +17,21 @@ export function shouldExcludeMessage({ metadata }: AssistantMessage) {
1717
1818export class DocsProviderTransport implements ChatTransport < AssistantMessage > {
1919 private model : LanguageModel ;
20+ private appName : string ;
2021 private instructions : string ;
2122
2223 constructor ( {
2324 instructions,
2425 model,
26+ appName,
2527 } : {
2628 instructions : string ;
2729 model : LanguageModel ;
30+ appName : string ;
2831 } ) {
2932 this . instructions = instructions ;
3033 this . model = model ;
34+ this . appName = appName ;
3135 }
3236
3337 static emptyStream = new ReadableStream < UIMessageChunk > ( {
@@ -60,6 +64,9 @@ export class DocsProviderTransport implements ChatTransport<AssistantMessage> {
6064 model : this . model ,
6165 messages : convertToModelMessages ( filteredMessages ) ,
6266 abortSignal : abortSignal ,
67+ headers : {
68+ 'X-Request-Origin' : this . appName ,
69+ } ,
6370 providerOptions : {
6471 openai : {
6572 instructions : this . instructions ,
You can’t perform that action at this time.
0 commit comments