Skip to content

Confusion occurs in API calls when using both the interpret_agent and fanyi packages simultaneously. #817

@LiehaoYang

Description

@LiehaoYang

Hello
I encountered an issue with API call confusion when using both the interpret_agent and fanyi packages simultaneously. The specific code is as follows:

library(fanyi)
set_translate_option("xxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxxxx",
source = "baidu")
library(clusterProfiler)
library(aisdk)
Sys.setenv(deepseek_API_KEY = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
model <- create_deepseek()$language_model("deepseek-chat")

When I run

res <- interpret_agent(ego_mutated,
context = "Psoriasis",
add_ppi = TRUE,
model = model,
gene_fold_change = mutated_genes)

The following error occurred:

Error in value[3L]: Failed to call fanyi::chat_request. Error: cannot coerce type 'environment' to vector of type 'character'

When I restarted R and only set the API in interpret_agent, the same error occurred.
I would like to ask what methods I can use to solve this problem.
Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions