now working v1

This commit is contained in:
mike dupont 2023-12-10 17:54:51 -05:00
parent ad7fc5450e
commit 7025832f4d
3 changed files with 9 additions and 6 deletions

View file

@ -592,7 +592,8 @@ main: examples/main/main.cpp ocaml-example-script.o plugin_nodejs.o plugin_oca
@echo
@echo '==== Run ./main -h for help. ===='
@echo
ocaml-example-script.o:
#nasty hack
ocaml-example-script.o: caml_src/step.ml
ocamlopt -g -fPIC -linkall -output-obj caml_src/step.ml -o ocaml-example-script.o
infill: examples/infill/infill.cpp ggml.o llama.o $(COMMON_DEPS) console.o grammar-parser.o $(OBJS)

View file

@ -8,9 +8,13 @@ let shutdown () =
Printf.printf "Shutting down Game module...\n";
flush stdout;;
let step () =
(* Printf.printf "bla\n"; *)
flush stdout;;
let step (s:string) : string =
Printf.printf "Hello Ocaml from LLama\n";
flush stdout;
s ^ "Hello Ocaml\n";;
(* main/init *)
let () =

View file

@ -81,8 +81,6 @@ std::string process_output_plugin_ocaml(const std::string start,
assert( step_fn );
value ocamlString = caml_copy_string(input.c_str());
//
value result= caml_callback( *step_fn, ocamlString );
std::string resultString = "todo";
//String_val(result);