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: 3 additions & 2 deletions src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Textkernel.Tx.Models.Resume.Metadata;
using System;
using System.Collections;
using System.Linq;
using System.IO;
using System.Text.Json;
using System.Threading.Tasks;
Expand Down Expand Up @@ -43,13 +44,13 @@ public async Task TestParseBadInput(Document document, Type expectedExceptionTyp
}

[Test]
public void TestLargeDocumentParse()
public void TestLLMLargeDocumentParse()
{
TxException e = Assert.ThrowsAsync<TxException>(async () => {
await Client.Parser.ParseResume(new ParseRequest(new Document(new byte[20_000_000], DateTime.Now)));
});

Assert.AreEqual(e.Message, "Request body was too large.");
Assert.IsTrue(e.Message.StartsWith("Request is too large to be processed by the server. Please do not send requests larger than"));
}

[Test]
Expand Down
5 changes: 0 additions & 5 deletions src/Textkernel.Tx.SDK/Services/ServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ internal static async Task<string> GetBodyIfDebug(HttpRequestMessage request)

internal static async Task<T> ProcessResponse<T>(HttpResponseMessage response, HttpRequestMessage request) where T : ITxResponse
{
if (response != null && response.StatusCode == System.Net.HttpStatusCode.RequestEntityTooLarge)
{
throw new TxException(await GetBodyIfDebug(request), response, new ApiResponseInfoLite { Code = "Error", Message = "Request body was too large." }, null);
}

T data = await DeserializeBody<T>(response);

if (response != null && data == null)
Expand Down
Loading