Current section

9 Versions

Jump to

Compare versions

11 files changed
+109 additions
-56 deletions
  @@ -1,5 +1,5 @@
1 1 name = "llmgleam"
2 - version = "0.0.3"
2 + version = "0.0.4"
3 3
4 4 description = "Gleam bindings for various LLMs"
5 5 licences = ["MIT"]
  @@ -1,6 +1,6 @@
1 1 {<<"name">>, <<"llmgleam">>}.
2 2 {<<"app">>, <<"llmgleam">>}.
3 - {<<"version">>, <<"0.0.3">>}.
3 + {<<"version">>, <<"0.0.4">>}.
4 4 {<<"description">>, <<"Gleam bindings for various LLMs"/utf8>>}.
5 5 {<<"licenses">>, [<<"MIT">>]}.
6 6 {<<"build_tools">>, [<<"gleam">>]}.
  @@ -13,6 +13,11 @@
13 13 {<<"optional">>, false},
14 14 {<<"requirement">>, <<">= 0.44.0 and < 2.0.0">>}
15 15 ]},
16 + {<<"gleam_http">>, [
17 + {<<"app">>, <<"gleam_http">>},
18 + {<<"optional">>, false},
19 + {<<"requirement">>, <<">= 4.1.1 and < 5.0.0">>}
20 + ]},
16 21 {<<"gleam_hackney">>, [
17 22 {<<"app">>, <<"gleam_hackney">>},
18 23 {<<"optional">>, false},
  @@ -23,11 +28,6 @@
23 28 {<<"optional">>, false},
24 29 {<<"requirement">>, <<">= 1.0.2 and < 2.0.0">>}
25 30 ]},
26 - {<<"gleam_http">>, [
27 - {<<"app">>, <<"gleam_http">>},
28 - {<<"optional">>, false},
29 - {<<"requirement">>, <<">= 4.1.1 and < 5.0.0">>}
30 - ]},
31 31 {<<"gleam_json">>, [
32 32 {<<"app">>, <<"gleam_json">>},
33 33 {<<"optional">>, false},
  @@ -1,5 +1,5 @@
1 1 {application, llmgleam, [
2 - {vsn, "0.0.3"},
2 + {vsn, "0.0.4"},
3 3 {applications, [envoy,
4 4 gleam_hackney,
5 5 gleam_http,
  @@ -1,19 +1,20 @@
1 1 -module(llmgleam).
2 2 -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
3 3 -define(FILEPATH, "src/llmgleam.gleam").
4 - -export([new_client/2, completion/3]).
4 + -export([new_client/2, completion/4]).
5 5
6 - -file("src/llmgleam.gleam", 4).
6 + -file("src/llmgleam.gleam", 5).
7 7 -spec new_client(llmgleam@client:provider(), binary()) -> llmgleam@client:client().
8 8 new_client(Provider, Api_key) ->
9 9 llmgleam@client:new_client(Provider, Api_key).
10 10
11 - -file("src/llmgleam.gleam", 8).
11 + -file("src/llmgleam.gleam", 9).
12 12 -spec completion(
13 13 llmgleam@client:client(),
14 14 binary(),
15 - list(llmgleam@types:chat_message())
15 + list(llmgleam@types:chat_message()),
16 + gleam@option:option(binary())
16 17 ) -> {ok, llmgleam@types:completion()} |
17 18 {error, llmgleam@types:completion_error()}.
18 - completion(Client, Model, Messages) ->
19 - llmgleam@client:completion(Client, Model, Messages).
19 + completion(Client, Model, Messages, System_instruction) ->
20 + llmgleam@client:completion(Client, Model, Messages, System_instruction).
  @@ -1,3 +1,4 @@
1 + import gleam/option
1 2 import llmgleam/client
2 3 import llmgleam/types
3 4
  @@ -9,6 +10,7 @@ pub fn completion(
9 10 client: client.Client,
10 11 model: String,
11 12 messages: List(types.ChatMessage),
13 + system_instruction: option.Option(String)
12 14 ) -> Result(types.Completion, types.CompletionError) {
13 - client.completion(client, model, messages)
15 + client.completion(client, model, messages, system_instruction)
14 16 }
Loading more files…