Skip to content
Snippets Groups Projects
Select Git revision
  • 0584756155b1771d0dc7d9c53054768be31a000e
  • main default protected
  • editUser
  • loadTests
  • fixTests
  • userhandling
  • updateEmbeddings
  • addRAGSources
  • testing
  • conversations
  • inputValidation
  • rag
  • chatting
  • userauth
14 results

User.js

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    util.R 631 B
    randomized_sleep <- function() {
      
      wait_time <- sample(seq(5, 10, 0.5), 1) # generate random number between 5 and 10
      print(paste0("Waiting ", wait_time, " seconds")) # print waiting
      Sys.sleep(wait_time) # wait
      
    }
    
    getCurrentFileLocation <-  function()
    {
      this_file <- commandArgs() %>% 
        tibble::enframe(name = NULL) %>%
        tidyr::separate(col=value, into=c("key", "value"), sep="=", fill='right') %>%
        dplyr::filter(key == "--file") %>%
        dplyr::pull(value)
      if (length(this_file)==0) # if called out of R studio
      {
        this_file <- rstudioapi::getSourceEditorContext()$path
      }
      return(dirname(this_file))
    }