Skip to content

Commit 1df0dee

Browse files
committed
Cleanup legacy LLM text output code
1 parent 6e5c3f7 commit 1df0dee

File tree

4 files changed

+3
-151
lines changed

4 files changed

+3
-151
lines changed

src/Elastic.Markdown/Exporters/LLMTextExporter.cs

Lines changed: 0 additions & 127 deletions
This file was deleted.

tests/authoring/Framework/HtmlAssertions.fs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -144,27 +144,6 @@ actual: {actual}
144144
let defaultFile = actual.MarkdownResults |> Seq.find (fun r -> r.File.RelativePath = "index.md")
145145
defaultFile |> toHtml expected
146146

147-
[<DebuggerStepThrough>]
148-
let toLLM ([<LanguageInjection("markdown")>]expected: string) (actual: MarkdownResult) =
149-
let actualLLM =
150-
let buildContext = actual.Context.Generator.Context
151-
let writer = new StringWriter()
152-
let renderer = LlmMarkdownRenderer(writer, BuildContext = buildContext)
153-
renderer.Render(actual.Document) |> ignore
154-
writer.ToString()
155-
156-
let difference = diff expected actualLLM
157-
match difference with
158-
| s when String.IsNullOrEmpty s -> ()
159-
| d ->
160-
let msg = $"""LLM text was not equal
161-
-- DIFF --
162-
{d}
163-
164-
"""
165-
raise (XunitException(msg))
166-
167-
168147
[<DebuggerStepThrough>]
169148
let containsHtml ([<LanguageInjection("html")>]expected: string) (actual: MarkdownResult) =
170149

tests/authoring/Framework/LlmMarkdownAssertions.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ open Xunit.Sdk
1414
[<AutoOpen>]
1515
module LlmMarkdownAssertions =
1616

17-
let toNewLLM (actual: MarkdownResult) =
17+
let toLlmMarkdown (actual: MarkdownResult) =
1818
use writer = new StringWriter()
1919
let markdownExportFileContext = MarkdownExportFileContext(
2020
BuildContext = actual.Context.Generator.Context,
@@ -29,7 +29,7 @@ module LlmMarkdownAssertions =
2929
let convertsToNewLLM ([<LanguageInjection("markdown")>]expected: string) (actual: Lazy<GeneratorResults>) =
3030
let results = actual.Value
3131
let defaultFile = results.MarkdownResults |> Seq.find (fun r -> r.File.RelativePath = "index.md")
32-
let actualLLM = toNewLLM defaultFile
32+
let actualLLM = toLlmMarkdown defaultFile
3333
let expectedWithTitle = $"{expected}".Trim()
3434
let difference = diff expectedWithTitle actualLLM
3535
match difference with

tests/authoring/LlmMarkdown/LlmMarkdownOutput.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ This text is also visible
337337
// Get the actual LLM output string for additional assertions
338338
let results = markdown.Value
339339
let defaultFile = results.MarkdownResults |> Seq.find (fun r -> r.File.RelativePath = "index.md")
340-
let actualLLM = toNewLLM defaultFile
340+
let actualLLM = toLlmMarkdown defaultFile
341341

342342
// Test that visible content is present and formatted correctly
343343
test <@ actualLLM = "This text is visible\nThis text is also visible" @>

0 commit comments

Comments
 (0)