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
| from __future__ import annotations | |
| import math | |
| from typing import Sequence | |
| def cosine(a: Sequence[float], b: Sequence[float]) -> float: | |
| dot = 0.0 | |
| na = 0.0 | |
| nb = 0.0 |
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
| from __future__ import annotations | |
| from dataclasses import dataclass | |
| from typing import List | |
| @dataclass(frozen=True) | |
| class Note: | |
| note_id: str | |
| content: str | |
| source: str | None = None |
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
| from __future__ import annotations | |
| from vertexai.preview.generative_models import GenerativeModel, Part | |
| from app.common.config import Settings | |
| from app.llm.vertex_init import init_vertex | |
| def generate( | |
| settings: Settings, |
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
| from __future__ import annotations | |
| from typing import List | |
| from vertexai.language_models import TextEmbeddingModel | |
| from app.common.config import Settings | |
| from app.llm.vertex_init import init_vertex | |
| _MODEL: TextEmbeddingModel | None = None |
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
| import logging | |
| import vertexai | |
| from app.common.config import Settings | |
| _INITIALIZED = False | |
| def init_vertex(settings: Settings) -> None: | |
| """Initialize Vertex AI once per process.""" | |
| global _INITIALIZED |
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
| import logging | |
| import os | |
| def setup_logging() -> None: | |
| level = os.getenv("LOG_LEVEL", "INFO").upper() | |
| logging.basicConfig( | |
| level=getattr(logging, level, logging.INFO), | |
| format="%(asctime)s %(levelname)s %(name)s - %(message)s", | |
| ) |
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
| import os | |
| from dataclasses import dataclass | |
| def _env(name: str, default: str | None = None) -> str | None: | |
| v = os.getenv(name) | |
| if v is None or v == "": | |
| return default | |
| return v |
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
| from __future__ import annotations | |
| import logging | |
| from typing import Optional | |
| from fastapi import FastAPI, Form, File, UploadFile, HTTPException | |
| from fastapi.responses import JSONResponse | |
| from app.common.config import Settings | |
| from app.common.logging_utils import setup_logging |
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
| 0. Accessing the Credit cards section | |
| 1. Verify the Autofill credit cards toggle on/off | |
| 2. Verify the Edit Saved Cards view | |
| 3. Turn History search suggestions on/off | |
| 4. Empty tab tray - grid view | |
| 5. Video with DRM content can be played. (Notification not yet implemented) | |
| 6. Clear key DRM video can be played. (Notification not yet implemented) | |
| 7. Add a new tab to a collection from tabs tray | |
| 8. Notifications permission prompt | |
| 9. Location permission prompts |
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
| # save this configuration to a file called: firebase.yaml | |
| # | |
| # gcloud args match the official gcloud cli | |
| # https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run | |
| # | |
| # run command: | |
| # gcloud beta firebase test android run firebase.yaml:x86 | |
| # | |
| x86: |