Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ export async function runCreateLlama({
...dataSourceArgs,
"--vector-db",
vectorDb,
"--open-ai-key",
process.env.OPENAI_API_KEY,
"--use-pnpm",
"--port",
port,
Expand All @@ -103,8 +101,6 @@ export async function runCreateLlama({
tools ?? "none",
"--observability",
"none",
"--llama-cloud-key",
process.env.LLAMA_CLOUD_API_KEY,
];

if (templateUI) {
Expand Down
3 changes: 2 additions & 1 deletion helpers/providers/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ora from "ora";
import { red } from "picocolors";
import prompts from "prompts";
import { ModelConfigParams, ModelConfigQuestionsParams } from ".";
import { isCI } from "../../questions";
import { questionHandlers } from "../../questions/utils";

const OPENAI_API_URL = "https://api.openai.com/v1";
Expand Down Expand Up @@ -30,7 +31,7 @@ export async function askOpenAIQuestions({
},
};

if (!config.apiKey) {
if (!config.apiKey && !isCI) {
const { key } = await prompts(
{
type: "text",
Expand Down
4 changes: 3 additions & 1 deletion questions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { askProQuestions } from "./questions";
import { askSimpleQuestions } from "./simple";
import { QuestionArgs, QuestionResults } from "./types";

export const isCI = ciInfo.isCI || process.env.PLAYWRIGHT_TEST === "1";

export const askQuestions = async (
args: QuestionArgs,
): Promise<QuestionResults> => {
if (ciInfo.isCI || process.env.PLAYWRIGHT_TEST === "1") {
if (isCI) {
return await getCIQuestionResults(args);
} else if (args.pro) {
// TODO: refactor pro questions to return a result object
Expand Down
3 changes: 2 additions & 1 deletion questions/questions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { blue, green } from "picocolors";
import prompts from "prompts";
import { isCI } from ".";
import { COMMUNITY_OWNER, COMMUNITY_REPO } from "../helpers/constant";
import { EXAMPLE_FILE } from "../helpers/datasources";
import { getAvailableLlamapackOptions } from "../helpers/llama-pack";
Expand Down Expand Up @@ -386,7 +387,7 @@ export const askProQuestions = async (program: QuestionArgs) => {

// Ask for LlamaCloud API key when using a LlamaCloud index or LlamaParse
if (isUsingLlamaCloud || program.useLlamaParse) {
if (!program.llamaCloudKey) {
if (!program.llamaCloudKey && !isCI) {
// if already set, don't ask again
// Ask for LlamaCloud API key
const { llamaCloudKey } = await prompts(
Expand Down
6 changes: 2 additions & 4 deletions templates/types/streaming/fastapi/app/services/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,11 @@ def _add_file_to_llama_cloud_index(
except ImportError as e:
raise ValueError("LlamaCloudFileService is not found") from e

project_id = index._get_project_id()
pipeline_id = index._get_pipeline_id()
# LlamaCloudIndex is a managed index so we can directly use the files
upload_file = (file_name, BytesIO(file_data))
doc_id = LLamaCloudFileService.add_file_to_pipeline(
project_id,
pipeline_id,
index.project.id,
index.pipeline.id,
upload_file,
custom_metadata={},
)
Expand Down
Loading