llm-graph-builder icon indicating copy to clipboard operation
llm-graph-builder copied to clipboard

how to use llm-graph-builder as an api

Open seshubonam opened this issue 1 year ago • 5 comments

https://neo4j.com/labs/genai-ecosystem/llm-graph-builder/

the ui is cool, and to use this as a tool in agent frameworks, im trying to find a way to use it as an api.

to have all the functionality of the https://llm-graph-builder.neo4jlabs.com, as an api

any help? thanks!

seshubonam avatar Jul 15 '24 13:07 seshubonam

Original issue: #10912

RoloEdits avatar Jul 15 '24 13:07 RoloEdits

I didn't get a chance to review that PR. We should not be stripping arbitrary whitespace at the end. Only a single newline character should be trimmed (that is what kakoune does too for example) so trim_end is not the right function.

pascalkuthe avatar Jul 15 '24 14:07 pascalkuthe

I agree with #10912 only with realize this feature in new command like :pipe_trim and :pipe with previous raw behavior.

b52es avatar Jul 15 '24 14:07 b52es

I believe the new trim in pipe was supposed to check the selected text for a trailing newline character; if present, the return text of the external command must leave at least one trailing newline character.

b52es avatar Jul 15 '24 14:07 b52es

I can get a pr for this pretty quick, but just need to know the exact behavior. Should at least one newline always exist? Or no mater what remove a trailing newline if it exists?

The original issue brought up how having the output with trailing whitespace was cumbersome:

That’s a possible solution, but it means that the vast majority of the time you pipe to another command you’ll have to :trim too. IMO this is a behaviour that should be implemented by the pipe command for ease of use.

I’d also be open to it only trimming a single trailing newline too. But as it is, stuff like piping to uniq or sort or case conversion utils or a formatter will all insert a new line into your document because these tools do the “correct” thing for interactive shell usage. Both Vim and Kakoune do remove the final newline, for good reason :)

What does your use case look like? @b52es

RoloEdits avatar Jul 15 '24 15:07 RoloEdits

https://github.com/mawww/kakoune/blame/840f4ec3ed14281cea6dd17c4c38d302963ae16d/src/normal.cc#L612

this is what kakoune does. Thre is no 100% perfect solution since shell commands don't behave consistently but I think what kakoune setteled on is reasonable and ist useful in the majority of situations.

pascalkuthe avatar Jul 15 '24 15:07 pascalkuthe

I am not sure if it is the same issue as :pipe but I have a similar problem with :insert-output in helix 24.7. I have a program to generate contents of a file which should end in a newline. However, however many newlines I output at the end of the program, none appear from :insert-output. Has this been fixed as well?

The only workaround I can find is to change my program to output an extra character (a letter "x"), and then delete it. So the lines in my config.toml file look like this:

  "F1" = [":insert-output ~/.config/helix/print-changelog.pl",                  
          "goto_line_start", "delete_selection_noyank"]         

(I tried doing it with "insert_newline" instead but this unhelpfully inserted an autoindent after the newline.)

GavinSmith0123 avatar Dec 27 '24 19:12 GavinSmith0123