Example Flow:
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: ipfs-env | |
| labels: | |
| app: ipfs | |
| data: | |
| IPFS_ENABLE_S3: "true" | |
| IPFS_S3_REGION: "us-east-1" | |
| IPFS_S3_BUCKET_NAME: "**" |
| type Book { | |
| name: String! @string(maxLength: 255) | |
| editor: Person @relation | |
| description: String! @string(maxLength: 1000) | |
| inLanguage: String! @string(maxLength: 50) | |
| keywords: [String!]! @list(maxLength: 20) | |
| isbn: [String!]! @list(maxLength: 5) | |
| publisher: Publisher @relation | |
| datePublished: Date | |
| locationCreated: Place @relation |
| type EmbeddingContext { | |
| # context is the transformed representation of a node before obtaining embeddings. | |
| # This can include the node's content with added context information for embedding tasks like summaries, etc. | |
| # Raw document is used if it's null. | |
| context: String @string(maxLength:100000000) | |
| # contextDescription is a human-readable description of the context. | |
| contextDescription: String! @string(maxLength:600) | |
| # category is the category or namespace for the embedding. |
| //Thank you ChatGPT | |
| function jsonSchemaToGraphQLFragment(schema, typeName, setPrefix = false) { | |
| // Helper function to resolve $ref references within the schema | |
| function resolveRef(ref, defs) { | |
| const refPath = ref.replace(/^#\/\$defs\//, ''); | |
| return defs[refPath]; | |
| } | |
| // Helper function to process each field in the schema |
| import os | |
| from langchain.agents import Tool | |
| from langchain.tools.retriever import create_retriever_tool | |
| from langchain_openai import OpenAIEmbeddings | |
| from indexclient import IndexChroma | |
| from crewai import Agent, Task, Crew, Process | |
| # TODO | |
| # I had to install langchain_chroma seperately. It should be included in the requirements |