@@ -4,46 +4,38 @@ namespace PromptProvider.Interfaces;
44
55public interface IPromptService
66{
7- /// <summary>
8- /// Create a new prompt version in Langfuse
9- /// </summary>
107 Task < PromptResponse > CreatePromptAsync ( CreatePromptRequest request , CancellationToken cancellationToken = default ) ;
118
12- /// <summary>
13- /// Create a new chat prompt version in Langfuse
14- /// </summary>
159 Task < ChatPromptResponse > CreateChatPromptAsync ( CreateChatPromptRequest request , CancellationToken cancellationToken = default ) ;
1610
1711 /// <summary>
18- /// Get a prompt by key with optional version or label. Falls back to local defaults if Langfuse is unavailable.
12+ /// Retrieves a text prompt.
13+ /// Precedence rules:
14+ /// 1) explicit method parameters (version/label)
15+ /// 2) configured prompt entry defaults
16+ /// 3) Langfuse default behavior.
17+ /// If a version is effective, label is ignored.
18+ /// Falls back to local configured defaults when remote retrieval fails.
1919 /// </summary>
20- /// <param name="promptKey">The prompt key/name</param>
21- /// <param name="version">Optional specific version number</param>
22- /// <param name="label">Optional label (e.g., "production", "latest")</param>
23- /// <param name="cancellationToken">Cancellation token</param>
2420 Task < PromptResponse ? > GetPromptAsync ( string promptKey , int ? version = null , string ? label = null , CancellationToken cancellationToken = default ) ;
2521
2622 /// <summary>
27- /// Get a chat prompt by key with optional version or label. Falls back to local defaults if Langfuse is unavailable.
23+ /// Retrieves a chat prompt.
24+ /// Precedence rules:
25+ /// 1) explicit method parameters (version/label)
26+ /// 2) configured prompt entry defaults
27+ /// 3) Langfuse default behavior.
28+ /// If a version is effective, label is ignored.
29+ /// Falls back to local configured defaults when remote retrieval fails.
2830 /// </summary>
29- /// <param name="promptKey">The prompt key/name</param>
30- /// <param name="version">Optional specific version number</param>
31- /// <param name="label">Optional label (e.g., "production", "latest")</param>
32- /// <param name="cancellationToken">Cancellation token</param>
3331 Task < ChatPromptResponse ? > GetChatPromptAsync ( string promptKey , int ? version = null , string ? label = null , CancellationToken cancellationToken = default ) ;
3432
35- /// <summary>
36- /// Get all prompts from Langfuse
37- /// </summary>
38- Task < List < LangfusePromptListItem > > GetAllPromptsAsync ( CancellationToken cancellationToken = default ) ;
33+ Task < IReadOnlyList < LangfusePromptListItem > > GetAllPromptsAsync ( CancellationToken cancellationToken = default ) ;
3934
4035 /// <summary>
41- /// Get multiple prompts by keys with optional label. Falls back to local defaults if Langfuse is unavailable .
36+ /// Retrieves prompts by keys. Individual key failures do not fail the whole batch .
4237 /// </summary>
43- Task < List < PromptResponse > > GetPromptsAsync ( IEnumerable < string > promptKeys , string ? label = null , CancellationToken cancellationToken = default ) ;
38+ Task < IReadOnlyList < PromptResponse > > GetPromptsAsync ( IEnumerable < string > promptKeys , string ? label = null , CancellationToken cancellationToken = default ) ;
4439
45- /// <summary>
46- /// Update labels for a specific prompt version in Langfuse
47- /// </summary>
4840 Task < PromptResponse > UpdatePromptLabelsAsync ( string promptKey , int version , UpdatePromptLabelsRequest request , CancellationToken cancellationToken = default ) ;
4941}
0 commit comments