Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RAGResult loading #11

Merged
merged 3 commits into from
Jul 23, 2024
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

## [0.2.1]

### Updated
- Increased compat bound for PromptingTools to 0.36-0.42

### Fixed
- Fixed a bug where serialized RAGResult without any sources wouldn't be rendered.

## [0.2.0]

### Updated
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Spehulak"
uuid = "13b2040c-5979-4bcf-93a6-c2323bf411ba"
authors = ["J S <[email protected]> and contributors"]
version = "0.2.0"
version = "0.2.1"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -20,7 +20,7 @@ DataFrames = "1.4,1.5,1.6"
Dates = "<0.0.1, 1"
GenieFramework = "2.1"
JSON3 = "1"
PromptingTools = "0.36"
PromptingTools = "0.36 - 0.42"
Statistics = "<0.0.1, 1"
StippleDownloads = "0.1"
Test = "<0.0.1, 1"
Expand Down
2 changes: 1 addition & 1 deletion src/conversation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function msg2snow(rag::RT.RAGResult; path::AbstractString = "")
end
context = String[]
for i in eachindex(rag.context)
source_str = if i > length(rag.sources)
source_str = if i <= length(rag.sources)
"Source: $(rag.sources[i])\n"
else
""
Expand Down
3 changes: 2 additions & 1 deletion test/conversation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ using Spehulak: msg2snow, SnowMessage, SnowConversation, SnowRAG
)
snow_res = msg2snow(res; path = "d/e/f")
@test snow_res.title == "d/e/f"
@test snow_res.context == ["Context ID 1\n-----\nContext:\n-----\nworld\n\n"]
@test snow_res.context ==
["Context ID 1\nSource: my\n-----\nContext:\n-----\nworld\n\n"]
@test snow_res.sources == ["my"]
@test snow_res.class == ""
@test snow_res.conv_main isa SnowConversation
Expand Down
Loading