Skip to content

Commit

Permalink
revert some things
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Sep 18, 2024
1 parent bf15407 commit 887ee37
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 25 deletions.
6 changes: 3 additions & 3 deletions OpenAI-DotNet/Chat/ChatRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ public ChatRequest(
}
}

Tools = toolList.ToList();

foreach (var tool in Tools)
foreach (var tool in toolList)
{
if (tool?.Function?.Arguments != null)
{
Expand All @@ -69,6 +67,8 @@ public ChatRequest(
}
}
}

Tools = toolList?.ToList();
}

/// <summary>
Expand Down
16 changes: 0 additions & 16 deletions OpenAI-DotNet/Common/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,6 @@ public string Invoke()
Console.WriteLine(e);
return JsonSerializer.Serialize(new { error = e.Message }, OpenAIClient.JsonSerializationOptions);
}
finally
{
Arguments = null;
}
}

/// <summary>
Expand All @@ -344,10 +340,6 @@ public T Invoke<T>()
Console.WriteLine(e);
throw;
}
finally
{
Arguments = null;
}
}

/// <summary>
Expand All @@ -374,10 +366,6 @@ public async Task<string> InvokeAsync(CancellationToken cancellationToken = defa
Console.WriteLine(e);
return JsonSerializer.Serialize(new { error = e.Message }, OpenAIClient.JsonSerializationOptions);
}
finally
{
Arguments = null;
}
}

/// <summary>
Expand All @@ -404,10 +392,6 @@ public async Task<T> InvokeAsync<T>(CancellationToken cancellationToken = defaul
Console.WriteLine(e);
throw;
}
finally
{
Arguments = null;
}
}

private static T InvokeInternal<T>(Function function, object[] invokeArgs)
Expand Down
5 changes: 2 additions & 3 deletions OpenAI-DotNet/Threads/CreateRunRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ public CreateRunRequest(
}
}

Tools = toolList.ToList();

foreach (var tool in Tools)
foreach (var tool in toolList)
{
if (tool?.Function?.Arguments != null)
{
Expand All @@ -181,6 +179,7 @@ public CreateRunRequest(
}
}

Tools = toolList?.ToList();
Metadata = metadata;
Temperature = temperature;
TopP = topP;
Expand Down
5 changes: 2 additions & 3 deletions OpenAI-DotNet/Threads/CreateThreadAndRunRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ public CreateThreadAndRunRequest(
}
}

Tools = toolList.ToList();

foreach (var tool in Tools)
foreach (var tool in toolList)
{
if (tool?.Function?.Arguments != null)
{
Expand All @@ -181,6 +179,7 @@ public CreateThreadAndRunRequest(
}
}

Tools = toolList?.ToList();
ToolResources = toolResources;
Metadata = metadata;
Temperature = temperature;
Expand Down

0 comments on commit 887ee37

Please sign in to comment.