diff --git a/src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs b/src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs index 285d0ca2..a4158cd6 100644 --- a/src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs +++ b/src/Textkernel.Tx.SDK.Tests/IntegrationTests/ParsingTests.cs @@ -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; @@ -43,13 +44,13 @@ public async Task TestParseBadInput(Document document, Type expectedExceptionTyp } [Test] - public void TestLargeDocumentParse() + public void TestLLMLargeDocumentParse() { TxException e = Assert.ThrowsAsync(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] diff --git a/src/Textkernel.Tx.SDK/Services/ServiceBase.cs b/src/Textkernel.Tx.SDK/Services/ServiceBase.cs index 8f8dc955..f6dcdbbb 100644 --- a/src/Textkernel.Tx.SDK/Services/ServiceBase.cs +++ b/src/Textkernel.Tx.SDK/Services/ServiceBase.cs @@ -65,11 +65,6 @@ internal static async Task GetBodyIfDebug(HttpRequestMessage request) internal static async Task ProcessResponse(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(response); if (response != null && data == null)