Fixing WithPromptsFromAssembly (#174)
* Fixing WithPromptsFromAssembly Was looking for tools * Fixing test
This commit is contained in:
parent
96fa96c1b2
commit
b9bb871787
2 changed files with 3 additions and 3 deletions
|
|
@ -176,7 +176,7 @@ public static partial class McpServerBuilderExtensions
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds types marked with the <see cref="McpServerToolTypeAttribute"/> attribute from the given assembly as prompts to the server.
|
||||
/// Adds types marked with the <see cref="McpServerPromptTypeAttribute"/> attribute from the given assembly as prompts to the server.
|
||||
/// </summary>
|
||||
/// <param name="builder">The builder instance.</param>
|
||||
/// <param name="promptAssembly">The assembly to load the types from. Null to get the current assembly</param>
|
||||
|
|
@ -190,7 +190,7 @@ public static partial class McpServerBuilderExtensions
|
|||
|
||||
return builder.WithPrompts(
|
||||
from t in promptAssembly.GetTypes()
|
||||
where t.GetCustomAttribute<McpServerToolTypeAttribute>() is not null
|
||||
where t.GetCustomAttribute<McpServerPromptTypeAttribute>() is not null
|
||||
select t);
|
||||
}
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ public class McpServerBuilderExtensionsPromptsTests : LoggedTest, IAsyncDisposab
|
|||
Assert.Contains(services.GetServices<McpServerPrompt>(), t => t.ProtocolPrompt.Name == nameof(MorePrompts.AnotherPrompt));
|
||||
}
|
||||
|
||||
[McpServerToolType]
|
||||
[McpServerPromptType]
|
||||
public sealed class SimplePrompts(ObjectWithId? id = null)
|
||||
{
|
||||
[McpServerPrompt, Description("Returns chat messages")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue