This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load docs | |
| from langchain.document_loaders import WebBaseLoader | |
| loader = WebBaseLoader("https://lilianweng.github.io/posts/2023-06-23-agent/") | |
| data = loader.load() | |
| # Split | |
| from langchain.text_splitter import RecursiveCharacterTextSplitter | |
| text_splitter = RecursiveCharacterTextSplitter(chunk_size = 500, chunk_overlap = 0) | |
| all_splits = text_splitter.split_documents(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create an application | |
| npx create-expo-app rate-repository-app --template expo-template-blank@sdk-50 | |
| // Note, that the @sdk-50 sets the project's Expo SDK version to 50, which supports React Native version 0.73. | |
| // Install dependencies | |
| npx expo install react-native-web@~0.19.6 [email protected] @expo/metro-runtime@~3.1.1 | |
| // Start the emulator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """CORS or "Cross-Origin Resource Sharing" refers to the situations when a frontend running in a browser has JavaScript code that communicates with a backend, and the backend is in a different "origin" than the frontend. | |
| Origin | |
| An origin is the combination of protocol (http, https), domain (myapp.com, localhost, localhost.tiangolo.com), and port (80, 443, 8080). | |
| So, all these are different origins: | |
| http://localhost |
OlderNewer