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
5 changes: 5 additions & 0 deletions runtime/csharp/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@ AZURE_OPENAI_API_KEY=
AZURE_OPENAI_CHAT_DEPLOYMENT=
AZURE_OPENAI_EMBEDDING_DEPLOYMENT=

# Azure Entra ID (for keyless auth tests)
# Set AZURE_TENANT_ID so DefaultAzureCredential picks the correct tenant.
# Requires 'Cognitive Services OpenAI User' role on the resource.
AZURE_TENANT_ID=

# Anthropic
ANTHROPIC_API_KEY=
10 changes: 7 additions & 3 deletions runtime/csharp/Prompty.Core.Tests/PipelineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,19 @@ public async Task TurnAsync_WithToolCalls_ExecutesTools()
}

[Fact]
public async Task TurnAsync_MissingTool_Throws()
public async Task TurnAsync_MissingTool_FeedsErrorBackToLlm()
{
InvokerRegistry.RegisterExecutor("openai", new ToolCallingExecutor());
InvokerRegistry.RegisterProcessor("openai", new ToolCallingProcessor());

var agent = CreateAgent();
agent.Tools = [new FunctionTool { Name = "get_weather", Kind = "function" }];
await Assert.ThrowsAsync<ToolHandlerError>(
() => Pipeline.TurnAsync(agent));
// With §9.9, tool errors are caught and fed back to the LLM.
// The loop continues and returns the final processed response.
var result = await Pipeline.TurnAsync(agent);
Assert.NotNull(result);
// The error is caught, the loop continues to the next LLM call which succeeds
Assert.IsType<string>(result);
}

// --- Thread Expansion ---
Expand Down
Loading
Loading