From da56b6c54001f0ae0b92750114c19fd2a606f93f Mon Sep 17 00:00:00 2001 From: kumeS Date: Fri, 10 May 2024 00:38:01 +0900 Subject: [PATCH] v0.3.2 --- DESCRIPTION | 4 ++-- R/discussion_flow_v1.R | 2 +- R/discussion_flow_v2.R | 2 +- {R => inst/OtherScript}/deepinfra4R.R | 25 +++++++++---------------- 4 files changed, 13 insertions(+), 20 deletions(-) rename {R => inst/OtherScript}/deepinfra4R.R (78%) diff --git a/DESCRIPTION b/DESCRIPTION index 79c63bf..e80b2f6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: chatAI4R Type: Package Title: Chat-Based Interactive Artificial Intelligence for R -Version: 0.3.1 -Date: 2024-02-18 +Version: 0.3.2 +Date: 2024-05-10 Authors@R: c( person (given = "Satoshi", family = "Kume", role = c("aut", "cre"), diff --git a/R/discussion_flow_v1.R b/R/discussion_flow_v1.R index 8c70caf..52e87ba 100644 --- a/R/discussion_flow_v1.R +++ b/R/discussion_flow_v1.R @@ -60,7 +60,7 @@ DEEPL <- any(names(Sys.getenv()) == "DeepL_API_KEY") #Create graph nodes set.seed(123) -g <- igraph::graph(c(), directed = TRUE) +g <- igraph::make_graph(c(), directed = TRUE) g <- igraph::add_vertices(g, 4, name = c("H", "A", "B", "C")) layout <- igraph::layout_nicely(g)*10 #layout <- igraph::layout_with_fr(g, area = vcount(g)^3) diff --git a/R/discussion_flow_v2.R b/R/discussion_flow_v2.R index 6ba0db2..77db3a5 100644 --- a/R/discussion_flow_v2.R +++ b/R/discussion_flow_v2.R @@ -66,7 +66,7 @@ DEEPL <- any(names(Sys.getenv()) == "DeepL_API_KEY") #Create graph nodes set.seed(123) -g <- igraph::graph(c(), directed = TRUE) +g <- igraph::make_graph(c(), directed = TRUE) g <- igraph::add_vertices(g, 4, name = c("H", "A", "B", "C")) layout <- igraph::layout_nicely(g)*10 #layout <- igraph::layout_with_fr(g, area = vcount(g)^3) diff --git a/R/deepinfra4R.R b/inst/OtherScript/deepinfra4R.R similarity index 78% rename from R/deepinfra4R.R rename to inst/OtherScript/deepinfra4R.R index 4b3601f..abec44b 100644 --- a/R/deepinfra4R.R +++ b/inst/OtherScript/deepinfra4R.R @@ -1,21 +1,14 @@ -R Function for Deepinfra APIs - -この関数は、Deepinfra APIsを使った実行をサポートします。 -Llama-2、CodeLlama、PhindなどをDeepinfraのAPIを使って実行します。 - -使用前に、`Sys.setenv(DEEPINFRA_API_KEY = "Your API key")`を定義してください。 -prompt: string, text to generate from - - -Parameter_Setting -max_new_tokens: integer, default value is 512, maximum length of the newly generated generated text. -temperature: number, default value is 0.7, temperature to use for sampling - -top_p: number, default value is 0.9, Sample from the set of tokens with highest probability such that sum of probabilies is higher than p. - - +#R Function for Deepinfra APIs +#この関数は、Deepinfra APIsを使った実行をサポートします。 +#Llama-2、CodeLlama、PhindなどをDeepinfraのAPIを使って実行します。 +#使用前に、`Sys.setenv(DEEPINFRA_API_KEY = "Your API key")`を定義してください。 +#prompt: string, text to generate from +#Parameter_Setting +#max_new_tokens: integer, default value is 512, maximum length of the newly generated generated text. +#temperature: number, default value is 0.7, temperature to use for sampling +#top_p: number, default value is 0.9, Sample from the set of tokens with highest probability such that sum of probabilies is higher than p. deepinfra4R <- function(prompt,