Skip to content

Commit

Permalink
"Replace HTTP with HTTPS in BilibiliLoader.swift and print the update…
Browse files Browse the repository at this point in the history
…d thumbnail URL in langchain_swiftTests.swift."
  • Loading branch information
buhe committed Aug 1, 2023
1 parent 79a4469 commit b5adb39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/LangChain/document_loaders/BilibiliLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public struct BilibiliLoader: BaseLoader {
return [Document(page_content: info!.subtitle, metadata: [
"title": info!.title,
"desc": info!.desc,
"thumbnail": info!.thumbnail
"thumbnail": info!.thumbnail.replacingOccurrences(of: "http", with: "https")
])]
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/LangChainTests/langchain_swiftTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ May God bless you all. May God protect our troops.
func testBilibiliLoader() async throws {
let loader = BilibiliLoader(videoId: "BV1fu411G7e3")
let doc = await loader.load()

print(doc.first!.metadata["thumbnail"]!)
XCTAssertFalse(doc.isEmpty)
XCTAssertNotEqual("", doc.first!.page_content)
}
Expand Down

0 comments on commit b5adb39

Please sign in to comment.