-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added nextjs-plugin package for quick next.js config setup feat: add codelens for react
- Loading branch information
Showing
180 changed files
with
50,707 additions
and
3,796 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"version": "0.1.0", | ||
"description": "The WASM package for baml-fmt", | ||
"main": "./dist/src/baml_schema_build.js", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
|
32 changes: 32 additions & 0 deletions
32
engine/language_client_codegen/baml_src/baml_client/__init__.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
############################################################################### | ||
# | ||
# Welcome to Baml! To use this generated code, please run the following: | ||
# | ||
# $ pip install baml | ||
# | ||
############################################################################### | ||
|
||
# This file was generated by BAML: please do not edit it. Instead, edit the | ||
# BAML files and re-generate this code. | ||
# | ||
# ruff: noqa: E501,F401 | ||
# flake8: noqa: E501,F401 | ||
# pylint: disable=unused-import,line-too-long | ||
# fmt: off | ||
from . import types | ||
from . import tracing | ||
from . import partial_types | ||
from .globals import reset_baml_env_vars | ||
|
||
|
||
from .async_client import b | ||
|
||
|
||
|
||
__all__ = [ | ||
"b", | ||
"partial_types", | ||
"tracing", | ||
"types", | ||
"reset_baml_env_vars", | ||
] |
67 changes: 67 additions & 0 deletions
67
engine/language_client_codegen/baml_src/baml_client/async_client.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
############################################################################### | ||
# | ||
# Welcome to Baml! To use this generated code, please run the following: | ||
# | ||
# $ pip install baml | ||
# | ||
############################################################################### | ||
|
||
# This file was generated by BAML: please do not edit it. Instead, edit the | ||
# BAML files and re-generate this code. | ||
# | ||
# ruff: noqa: E501,F401 | ||
# flake8: noqa: E501,F401 | ||
# pylint: disable=unused-import,line-too-long | ||
# fmt: off | ||
from typing import Any, Dict, List, Optional, TypeVar, Union, TypedDict, Type, Literal, cast | ||
from typing_extensions import NotRequired | ||
import pprint | ||
|
||
import baml_py | ||
from pydantic import BaseModel, ValidationError, create_model | ||
|
||
from . import partial_types, types | ||
from .types import Checked, Check | ||
from .type_builder import TypeBuilder | ||
from .globals import DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX, DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME | ||
|
||
|
||
OutputType = TypeVar('OutputType') | ||
|
||
|
||
# Define the TypedDict with optional parameters having default values | ||
class BamlCallOptions(TypedDict, total=False): | ||
tb: NotRequired[TypeBuilder] | ||
client_registry: NotRequired[baml_py.baml_py.ClientRegistry] | ||
|
||
class BamlAsyncClient: | ||
__runtime: baml_py.BamlRuntime | ||
__ctx_manager: baml_py.BamlCtxManager | ||
__stream_client: "BamlStreamClient" | ||
|
||
def __init__(self, runtime: baml_py.BamlRuntime, ctx_manager: baml_py.BamlCtxManager): | ||
self.__runtime = runtime | ||
self.__ctx_manager = ctx_manager | ||
self.__stream_client = BamlStreamClient(self.__runtime, self.__ctx_manager) | ||
|
||
@property | ||
def stream(self): | ||
return self.__stream_client | ||
|
||
|
||
|
||
|
||
|
||
class BamlStreamClient: | ||
__runtime: baml_py.BamlRuntime | ||
__ctx_manager: baml_py.BamlCtxManager | ||
|
||
def __init__(self, runtime: baml_py.BamlRuntime, ctx_manager: baml_py.BamlCtxManager): | ||
self.__runtime = runtime | ||
self.__ctx_manager = ctx_manager | ||
|
||
|
||
|
||
b = BamlAsyncClient(DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME, DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX) | ||
|
||
__all__ = ["b"] |
41 changes: 41 additions & 0 deletions
41
engine/language_client_codegen/baml_src/baml_client/globals.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
############################################################################### | ||
# | ||
# Welcome to Baml! To use this generated code, please run the following: | ||
# | ||
# $ pip install baml | ||
# | ||
############################################################################### | ||
|
||
# This file was generated by BAML: please do not edit it. Instead, edit the | ||
# BAML files and re-generate this code. | ||
# | ||
# ruff: noqa: E501,F401 | ||
# flake8: noqa: E501,F401 | ||
# pylint: disable=unused-import,line-too-long | ||
# fmt: off | ||
import os | ||
|
||
from baml_py import BamlCtxManager, BamlRuntime | ||
from baml_py.baml_py import BamlError | ||
from .inlinedbaml import get_baml_files | ||
from typing import Dict | ||
|
||
DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME = BamlRuntime.from_files( | ||
"baml_src", | ||
get_baml_files(), | ||
os.environ.copy() | ||
) | ||
DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX = BamlCtxManager(DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME) | ||
|
||
def reset_baml_env_vars(env_vars: Dict[str, str]): | ||
if DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX.allow_reset(): | ||
DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME.reset( | ||
"baml_src", | ||
get_baml_files(), | ||
env_vars | ||
) | ||
DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX.reset() | ||
else: | ||
raise BamlError("Cannot reset BAML environment variables while there are active BAML contexts.") | ||
|
||
__all__ = [] |
22 changes: 22 additions & 0 deletions
22
engine/language_client_codegen/baml_src/baml_client/inlinedbaml.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
############################################################################### | ||
# | ||
# Welcome to Baml! To use this generated code, please run the following: | ||
# | ||
# $ pip install baml | ||
# | ||
############################################################################### | ||
|
||
# This file was generated by BAML: please do not edit it. Instead, edit the | ||
# BAML files and re-generate this code. | ||
# | ||
# ruff: noqa: E501,F401 | ||
# flake8: noqa: E501,F401 | ||
# pylint: disable=unused-import,line-too-long | ||
# fmt: off | ||
|
||
file_map = { | ||
|
||
} | ||
|
||
def get_baml_files(): | ||
return file_map |
41 changes: 41 additions & 0 deletions
41
engine/language_client_codegen/baml_src/baml_client/partial_types.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
############################################################################### | ||
# | ||
# Welcome to Baml! To use this generated code, please run the following: | ||
# | ||
# $ pip install baml | ||
# | ||
############################################################################### | ||
|
||
# This file was generated by BAML: please do not edit it. Instead, edit the | ||
# BAML files and re-generate this code. | ||
# | ||
# ruff: noqa: E501,F401 | ||
# flake8: noqa: E501,F401 | ||
# pylint: disable=unused-import,line-too-long | ||
# fmt: off | ||
import baml_py | ||
from enum import Enum | ||
from pydantic import BaseModel, ConfigDict | ||
from typing import Dict, Generic, List, Optional, TypeVar, Union, Literal | ||
|
||
from . import types | ||
from .types import Checked, Check | ||
|
||
############################################################################### | ||
# | ||
# These types are used for streaming, for when an instance of a type | ||
# is still being built up and any of its fields is not yet fully available. | ||
# | ||
############################################################################### | ||
|
||
T = TypeVar('T') | ||
class StreamState(BaseModel, Generic[T]): | ||
value: T | ||
state: Literal["Pending", "Incomplete", "Complete"] | ||
|
||
|
||
class Foo(BaseModel): | ||
s: Optional[str] = None | ||
|
||
class Greg(BaseModel): | ||
inner: StreamState[Checked[Optional["Foo"],Literal["foo"]]] |
Oops, something went wrong.