Skip to content

Commit 1440847

Browse files
Merge pull request #2477 from solliancenet/cj-context-api-logging
Improve logging in Context API
2 parents 300e8dc + 6bec50b commit 1440847

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/dotnet/Context/Services/CodeSessionService.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using FoundationaLLM.Context.Interfaces;
1010
using Microsoft.AspNetCore.Http;
1111
using Microsoft.Extensions.Logging;
12+
using System.Text.Json;
1213

1314
namespace FoundationaLLM.Context.Services
1415
{
@@ -187,12 +188,19 @@ public async Task<CodeSessionFileDownloadResponse> DownloadFilesFromCodeSession(
187188
codeSessionRecord.Id,
188189
codeSessionRecord.Endpoint);
189190

191+
_logger.LogInformation("GetCodeSessionFileStoreItems result from {CodeSessionProviderName}: {CodeSessionProviderResult}",
192+
codeSessionProviderService.ProviderName,
193+
JsonSerializer.Serialize(fileStoreItems));
194+
190195
var newFileStoreItems = fileStoreItems
191196
.Where(x =>
192197
x.ParentPath != "/"
193198
|| !codeSessionFileUploadRecord.FileUploadSuccess.ContainsKey(x.Name)
194199
|| !codeSessionFileUploadRecord.FileUploadSuccess[x.Name]);
195200

201+
_logger.LogInformation("New file store items to download: {NewFileStoreItems}",
202+
JsonSerializer.Serialize(newFileStoreItems));
203+
196204
var result = new CodeSessionFileDownloadResponse();
197205

198206
foreach (var newFileStoreItem in newFileStoreItems)
@@ -204,9 +212,20 @@ public async Task<CodeSessionFileDownloadResponse> DownloadFilesFromCodeSession(
204212
newFileStoreItem.ParentPath);
205213

206214
if (fileContentStream == null)
215+
{
216+
_logger.LogError("DownloadFileFromCodeSession result from {CodeSessionProviderName} for {FileStoreItemName} in {FileStoreItemPath}: error.",
217+
codeSessionProviderService.ProviderName,
218+
newFileStoreItem.Name,
219+
newFileStoreItem.ParentPath);
207220
result.Errors.Add($"{newFileStoreItem.ParentPath}/{newFileStoreItem.Name}");
221+
}
208222
else
209223
{
224+
_logger.LogInformation("DownloadFileFromCodeSession result from {CodeSessionProviderName} for {FileStoreItemName} in {FileStoreItemPath}: success.",
225+
codeSessionProviderService.ProviderName,
226+
newFileStoreItem.Name,
227+
newFileStoreItem.ParentPath);
228+
210229
var fileRecord = await _fileService.CreateFile(
211230
codeSessionRecord.InstanceId,
212231
ContextRecordOrigins.CodeSession,

src/python/FoundationaLLMAgentPlugins/test/foundationallm_function_calling_workflow/test_workflow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@
3131
# user_prompt = "how do I beat the market"
3232
# user_prompt = "Who is the hero of the story?"
3333
# user_prompt = "Who are you?"
34-
user_prompt = "Summarize the file"
34+
# user_prompt = "Summarize the file"
3535
# user_prompt = "Calculate the first 20 terms of the Fibonacci series"
3636
# user_prompt = "Calculate the first 20 terms of the Fibonacci series and save the result as a text file."
3737
# user_prompt = "Generate a graph of a complex Fourier transformation"
3838
# user_prompt = "Create a chart based on the uploaded file"
3939
# user_prompt = "Who are you?"
4040
# user_prompt = "What files are in the uploaded zip?"
4141
# user_prompt = "List the files in the uploaded zip file. Use a code tool to provide the answer."
42+
user_prompt = "Plot the equation y=mx^2+b"
4243

4344
operation_id = str(uuid.uuid4())
44-
conversation_id = "20250609-225522-GLhSALpJDkOJjL1FS-eN8A"
45+
conversation_id = "20250610-090956-7YQTmcJC9USZs9r9qTTLtA"
4546

4647
user_identity_json = {"name": "Experimental Test", "user_name":"ciprian@foundationaLLM.ai","upn":"ciprian@foundationaLLM.ai"}
4748
full_request_json_file_name = 'test/full_request.json' # full original langchain request, contains agent, tools, exploded objects

0 commit comments

Comments
 (0)