diff --git a/.changeset/tricky-beers-bow.md b/.changeset/tricky-beers-bow.md new file mode 100644 index 0000000000000000000000000000000000000000..d4eb5a8f5ef7e84262e27f4c2d293fab90323cd3 --- /dev/null +++ b/.changeset/tricky-beers-bow.md @@ -0,0 +1,5 @@ +--- +"create-llama": patch +--- + +Add support for python 3.13 diff --git a/helpers/python.ts b/helpers/python.ts index 9dd686d803f468fa7d69f473f9164dbb405859d7..f57f6e97016bc0f1cffe24cb3d6333f262a64d1e 100644 --- a/helpers/python.ts +++ b/helpers/python.ts @@ -20,6 +20,7 @@ interface Dependency { name: string; version?: string; extras?: string[]; + constraints?: Record<string, string>; } const getAdditionalDependencies = ( @@ -51,6 +52,9 @@ const getAdditionalDependencies = ( dependencies.push({ name: "llama-index-vector-stores-pinecone", version: "^0.2.1", + constraints: { + python: ">=3.11,<3.13", + }, }); break; } @@ -76,6 +80,9 @@ const getAdditionalDependencies = ( dependencies.push({ name: "llama-index-vector-stores-qdrant", version: "^0.3.0", + constraints: { + python: ">=3.11,<3.13", + }, }); break; } @@ -279,14 +286,19 @@ const mergePoetryDependencies = ( value.version = dependency.version ?? value.version; value.extras = dependency.extras ?? value.extras; + // Merge constraints if they exist + if (dependency.constraints) { + value = { ...value, ...dependency.constraints }; + } + if (value.version === undefined) { throw new Error( `Dependency "${dependency.name}" is missing attribute "version"!`, ); } - // Serialize separately only if extras are provided - if (value.extras && value.extras.length > 0) { + // Serialize as object if there are any additional properties + if (Object.keys(value).length > 1) { existingDependencies[dependency.name] = value; } else { // Otherwise, serialize just the version string @@ -513,6 +525,9 @@ export const installPythonTemplate = async ({ addOnDependencies.push({ name: "llama-index-callbacks-arize-phoenix", version: "^0.2.1", + constraints: { + python: ">=3.11,<3.13", + }, }); } diff --git a/helpers/tools.ts b/helpers/tools.ts index 27ea1e45a07611f462f57e28fa0c80b86352aceb..2be926369ae782071b1d3a83c856a3f92eecc28d 100644 --- a/helpers/tools.ts +++ b/helpers/tools.ts @@ -62,7 +62,7 @@ export const supportedTools: Tool[] = [ dependencies: [ { name: "duckduckgo-search", - version: "6.1.7", + version: "^6.3.5", }, ], supportedFrameworks: ["fastapi", "nextjs", "express"], diff --git a/templates/types/streaming/fastapi/pyproject.toml b/templates/types/streaming/fastapi/pyproject.toml index 400991c52789fd35d97ab68945ee250ded1deb11..ed5433584e4df4e396b89978c85a0812960a470b 100644 --- a/templates/types/streaming/fastapi/pyproject.toml +++ b/templates/types/streaming/fastapi/pyproject.toml @@ -9,7 +9,7 @@ readme = "README.md" generate = "app.engine.generate:generate_datasource" [tool.poetry.dependencies] -python = ">=3.11,<3.13" +python = ">=3.11,<3.14" fastapi = "^0.109.1" uvicorn = { extras = ["standard"], version = "^0.23.2" } python-dotenv = "^1.0.0"