logfire API reference
239 public APIs from logfire (pydantic/logfire) — 81 classes, 64 functions, 94 methods. Signatures extracted by static analysis of the actual source.
Repository: pydantic/logfire
| Kind | Count |
|---|---|
| Classes | 81 |
| Functions | 64 |
| Methods | 94 |
API list
func
logfire-api.logfire_api.logfire_info() -> strShow versions of logfire, OS and related packages.
class
logfire._internal.auth.NewDeviceFlowMatches model of the same name in the backend.
class
logfire._internal.auth.UserTokenA user token.
method
logfire._internal.auth.UserToken.is_expired() -> boolWhether the token is expired.
class
logfire._internal.auth.UserTokenCollectionA collection of user tokens, read from a user tokens file.
method
logfire._internal.auth.UserTokenCollection.add_token(base_url:str, token:UserTokenData) -> UserTokenAdd a user token to the collection.
method
logfire._internal.auth.UserTokenCollection.get_token(base_url:str | None=None) -> UserTokenGet a user token from the collection.
method
logfire._internal.auth.UserTokenCollection.logout(base_url:str | None=None) -> list[str]Remove user token(s) from the collection.
class
logfire._internal.auth.UserTokenDataUser token data.
class
logfire._internal.auth.UserTokensFileDataContent of the file containing the user tokens.
func
logfire._internal.auth.poll_for_token(session:requests.Session, device_code:str, base_api_url:str) -> UserTokenDataPoll the Logfire API for the user token.
func
logfire._internal.auth.request_device_code(session:requests.Session, base_api_url:str) -> tuple[str, str]Request a device code from the Logfire API.
func
logfire._internal.auto_trace.install_auto_tracing(logfire:Logfire, modules:Sequence[str] | Callable[[AutoTraceModule], bool], *min_duration:float, *check_imported_modules:Literal['error', 'warn', 'ignore']='error') -> NoneInstall automatic tracing.
func
logfire._internal.cli.auth.parse_auth(args:argparse.Namespace) -> NoneAuthenticate with Logfire.
func
logfire._internal.cli.auth.parse_logout(args:argparse.Namespace) -> NoneLog out from Logfire.
func
logfire._internal.cli.gateway.parse_gateway(args:argparse.Namespace) -> NoneRun a local OAuth proxy for the Logfire AI Gateway.
class
logfire._internal.cli.gateway_auth.CimdOAuthClientPublic OAuth client identified by a CIMD URL.
class
logfire._internal.cli.gateway_auth.OAuthSessionIn-memory OAuth token state for the local gateway proxy.
func
logfire._internal.cli.gateway_auth.discover_oauth_metadata(http:Any, backend:str) -> OAuthMetadataFetch the backend's OAuth authorization server metadata.
func
logfire._internal.cli.logfire_info() -> strShow versions of logfire, OS and related packages.
func
logfire._internal.cli.main(args:list[str] | None=None) -> NoneRun the CLI.
func
logfire._internal.cli.parse_clean(args:argparse.Namespace) -> NoneRemove the contents of the Logfire data directory.
func
logfire._internal.cli.parse_create_new_project(args:argparse.Namespace) -> NoneCreate a new project.
func
logfire._internal.cli.parse_create_read_token(args:argparse.Namespace) -> NoneCreate a read token for a project.
func
logfire._internal.cli.parse_info(_args:argparse.Namespace) -> NoneShow versions of logfire, OS and related packages.
func
logfire._internal.cli.parse_list_projects(args:argparse.Namespace) -> NoneList user projects.
func
logfire._internal.cli.parse_use_project(args:argparse.Namespace) -> NoneUse an existing project.
func
logfire._internal.cli.prompt.parse_prompt(args:argparse.Namespace) -> NoneCreates a prompt to be used with your favorite LLM.
func
logfire._internal.cli.run.installed_packages() -> set[str]Get a set of all installed packages.
func
logfire._internal.cli.version_callback() -> NoneShow the version and exit.
class
logfire._internal.client.LogfireClientA Logfire HTTP client to interact with the API.
method
logfire._internal.client.LogfireClient.create_new_project(organization:str, project_name:str)Create a new project.
method
logfire._internal.client.LogfireClient.from_url(base_url:str | None, server_response_hook:ServerResponseCallback | None=None) -> SelfCreate a client from the provided base URL.
method
logfire._internal.client.LogfireClient.get_prompt(organization:str, project_name:str, issue:str) -> dict[str, Any]Get a prompt to be used with your favorite LLM.
method
logfire._internal.client.LogfireClient.get_user_information() -> dict[str, Any]Get information about the logged-in user.
method
logfire._internal.client.LogfireClient.get_user_organizations() -> list[dict[str, Any]]Get the organizations of the logged-in user.
method
logfire._internal.client.LogfireClient.get_user_projects() -> list[dict[str, Any]]Get the projects of the logged-in user.
class
logfire._internal.config.AdvancedOptionsOptions primarily used for testing by Logfire developers.
class
logfire._internal.config.CodeSourceSettings for the source code of the project.
class
logfire._internal.config.ConsoleOptionsOptions for controlling console output.
class
logfire._internal.config.LogfireCredentialsCredentials for logfire.dev.
method
logfire._internal.config.LogfireCredentials.from_token(token:str, session:requests.Session, base_url:str) -> Self | NoneCheck that the token is valid.
method
logfire._internal.config.LogfireCredentials.load_creds_file(creds_dir:Path) -> Self | NoneCheck if a credentials file exists and if so load it.
method
logfire._internal.config.LogfireCredentials.print_token_summary() -> NonePrint a summary of the existing project.
method
logfire._internal.config.LogfireCredentials.write_creds_file(creds_dir:Path) -> NoneWrite a credentials file to the given path.
class
logfire._internal.config.MetricsOptionsConfiguration of metrics.
class
logfire._internal.config.PydanticPluginOptions for the Pydantic plugin.
func
logfire._internal.config.get_base_url_from_token(token:str) -> strGet the base API URL from the token's region.
func
logfire._internal.config.get_git_revision_hash() -> strGet the current git commit hash.
class
logfire._internal.config_params.ParamManagerManage parameters for a Logfire instance.
method
logfire._internal.config_params.ParamManager.load_param(name:str, runtime:Any=None) -> AnyLoad a parameter given its name.
func
logfire._internal.db_statement_summary.summarize_query(db_statement:str) -> str | NoneSummarize a database statement, specifically SQL queries.
method
logfire._internal.exporters.console.SimpleConsoleSpanExporter.export(spans:Sequence[ReadableSpan]) -> SpanExportResultExport the spans to the console.
method
logfire._internal.exporters.console.SimpleConsoleSpanExporter.force_flush(timeout_millis:int=0) -> boolForce flush all spans, does nothing for this exporter.
func
logfire._internal.integrations.llm_providers.anthropic.make_tool_call_part(tool_call_id:str, name:str, arguments:Any) -> ToolCallPartHelper function to create a ToolCallPart.
func
logfire._internal.integrations.llm_providers.openai.make_tool_call_part(tool_call_id:str, name:str, arguments:Any) -> ToolCallPartHelper function to create a ToolCallPart.
class
logfire._internal.integrations.llm_providers.semconv.BlobPartBinary data part.
class
logfire._internal.integrations.llm_providers.semconv.FilePartProvider file reference part.
class
logfire._internal.integrations.llm_providers.semconv.OutputMessageAn output message with optional finish reason.
class
logfire._internal.integrations.llm_providers.semconv.ReasoningPartReasoning/thinking content part.
class
logfire._internal.integrations.llm_providers.semconv.TextPartText content part.
class
logfire._internal.integrations.llm_providers.semconv.ToolCallPartTool call part.
class
logfire._internal.integrations.llm_providers.semconv.ToolCallResponsePartTool call response part.
class
logfire._internal.integrations.llm_providers.types.StreamStateKeeps track of the state of a streamed response.
method
logfire._internal.integrations.llm_providers.types.StreamState.get_attributes(span_data:dict[str, Any]) -> dict[str, Any]Attributes to include in the log.
class
logfire._internal.integrations.pytest.LogfirePluginConfigConfiguration for the Logfire pytest plugin.
func
logfire._internal.integrations.pytest.pytest_addoption(parser:pytest.Parser) -> NoneAdd Logfire options to pytest.
func
logfire._internal.integrations.pytest.pytest_configure(config:pytest.Config) -> NoneConfigure Logfire when the plugin is enabled.
func
logfire._internal.integrations.pytest.pytest_runtest_makereport(item:pytest.Item, call:pytest.CallInfo[Any]) -> Generator[None, pytest.TestReport, None]Record test outcomes and exceptions.
func
logfire._internal.integrations.pytest.pytest_runtest_protocol(item:pytest.Item, nextitem:pytest.Item | None) -> Generator[None]Create a span for each test.
func
logfire._internal.integrations.pytest.pytest_sessionfinish(session:pytest.Session, exitstatus:int) -> NoneEnd the session span and flush traces.
func
logfire._internal.integrations.pytest.pytest_sessionstart(session:pytest.Session) -> NoneCreate a session span when the test session starts.
func
logfire._internal.integrations.pytest.pytest_xdist_setupnodes(config:Any, specs:Any) -> NoneInject TRACEPARENT into env before xdist spawns workers.
func
logfire._internal.json_schema.create_json_schema(obj:Any, seen:set[int]) -> JsonDictCreate a JSON Schema from the given object.
class
logfire._internal.main.LogfireThe main logfire class.
method
logfire._internal.main.Logfire.debug(msg_template:str, *_tags:Sequence[str] | None=None, *_exc_info:ExcInfo=False, **attributes:Any) -> NoneLog a debug message.
method
logfire._internal.main.Logfire.error(msg_template:str, *_tags:Sequence[str] | None=None, *_exc_info:ExcInfo=False, **attributes:Any) -> NoneLog an error message.
method
logfire._internal.main.Logfire.fatal(msg_template:str, *_tags:Sequence[str] | None=None, *_exc_info:ExcInfo=False, **attributes:Any) -> NoneLog a fatal message.
method
logfire._internal.main.Logfire.force_flush(timeout_millis:int=3000) -> boolForce flush all spans and metrics.
method
logfire._internal.main.Logfire.info(msg_template:str, *_tags:Sequence[str] | None=None, *_exc_info:ExcInfo=False, **attributes:Any) -> NoneLog an info message.
method
logfire._internal.main.Logfire.install_auto_tracing(modules:Sequence[str] | Callable[[AutoTraceModule], bool], *min_duration:float, *check_imported_modules:Literal['error', 'warn', 'ignore']='error') -> NoneInstall automatic tracing.
method
logfire._internal.main.Logfire.instrument_dspy(**kwargs:Any)Instrument [DSPy](https://dspy.ai/).
method
logfire._internal.main.Logfire.instrument_pydantic(record:PydanticPluginRecordValues='all', include:Iterable[str]=(), exclude:Iterable[str]=()) -> NoneInstrument Pydantic model validations.
method
logfire._internal.main.Logfire.instrument_system_metrics(config:SystemMetricsConfig | None=None, base:SystemMetricsBase='basic') -> NoneCollect system metrics.
method
logfire._internal.main.Logfire.log(level:LevelName | int, msg_template:str, attributes:dict[str, Any] | None=None, tags:Sequence[str] | None=None, exc_info:ExcInfo=False, console_log:bool | None=None) -> NoneLog a message.
method
logfire._internal.main.Logfire.metric_counter(name:str, *unit:str='', *description:str='') -> CounterCreate a counter metric.
method
logfire._internal.main.Logfire.metric_gauge(name:str, *unit:str='', *description:str='') -> GaugeCreate a gauge metric.
method
logfire._internal.main.Logfire.metric_histogram(name:str, *unit:str='', *description:str='') -> HistogramCreate a histogram metric.
method
logfire._internal.main.Logfire.metric_up_down_counter(name:str, *unit:str='', *description:str='') -> UpDownCounterCreate an up-down counter metric.
method
logfire._internal.main.Logfire.notice(msg_template:str, *_tags:Sequence[str] | None=None, *_exc_info:ExcInfo=False, **attributes:Any) -> NoneLog a notice message.
method
logfire._internal.main.Logfire.shutdown(timeout_millis:int=30000, flush:bool=True) -> boolShut down all tracers and meters.
method
logfire._internal.main.Logfire.trace(msg_template:str, *_tags:Sequence[str] | None=None, *_exc_info:ExcInfo=False, **attributes:Any) -> NoneLog a trace message.
method
logfire._internal.main.Logfire.url_from_eval(report:EvaluationReport[Any, Any, Any]) -> str | NoneGenerate a Logfire URL to view an evaluation report.
method
logfire._internal.main.Logfire.warning(msg_template:str, *_tags:Sequence[str] | None=None, *_exc_info:ExcInfo=False, **attributes:Any) -> NoneLog a warning message.
method
logfire._internal.main.Logfire.with_settings(*tags:Sequence[str]=(), *console_log:bool | None=None, *custom_scope_suffix:str | None=None) -> LogfireA new Logfire instance which uses the given settings.
method
logfire._internal.main.Logfire.with_tags(*tags:str) -> LogfireA new Logfire instance which always uses the given tags.
method
logfire._internal.main.Logfire.with_trace_sample_rate(sample_rate:float) -> LogfireA new Logfire instance with the given sampling ratio applied.
class
logfire._internal.main.NoopSpanImplements the same methods as `LogfireSpan` but does nothing.
func
logfire._internal.main.prepare_otlp_attribute(value:Any) -> otel_types.AttributeValueConvert a user attribute to an OpenTelemetry compatible type.
func
logfire._internal.main.prepare_otlp_attributes(attributes:dict[str, Any]) -> dict[str, otel_types.AttributeValue]Prepare attributes for sending to OpenTelemetry.
class
logfire._internal.scrubbing.ScrubberRedacts potentially sensitive data.
class
logfire._internal.scrubbing.ScrubbingOptionsOptions for redacting sensitive data.
class
logfire._internal.scrubbing.SpanScrubberDoes the actual scrubbing work.
func
logfire._internal.stack_info.is_user_code(code:CodeType) -> boolCheck if the code object is from user code.
func
logfire._internal.tracer.should_sample(span_context:SpanContext, attributes:Mapping[str, otel_types.AttributeValue]) -> boolDetermine if a span should be sampled.
func
logfire._internal.ulid.ulid(random:Random, ms_timestamp_generator:Callable[[], int]) -> intGenerate an integer ULID compatible with UUID v4.
class
logfire._internal.utils.BaseExceptionGroupStub for BaseExceptionGroup for Python < 3.11.
class
logfire._internal.utils.ReadableSpanDictA dictionary representation of a ReadableSpan.
class
logfire._internal.utils.UnexpectedResponseAn unexpected response was received from the server.
method
logfire._internal.utils.UnexpectedResponse.raise_for_status(response:Response) -> NoneLike the requests method, but raises a more informative exception.
func
logfire._internal.utils.get_version(version:str) -> VersionReturn a packaging.version.Version object from a version string.
func
logfire._internal.utils.platform_is_emscripten() -> boolReturn True if the platform is Emscripten, e.g.
func
logfire._internal.utils.read_toml_file(path:Path) -> dict[str, Any]Read a TOML file and return the parsed data.
func
logfire._internal.utils.span_to_dict(span:ReadableSpan) -> ReadableSpanDictSee ReadableSpanDict.
func
logfire._internal.utils.uniquify_sequence(seq:Sequence[T]) -> tuple[T, ...]Remove duplicates from a sequence preserving order.
class
logfire.db_api.ConnectionPEP 249 Connection wrapping a `LogfireQueryClient`.
method
logfire.db_api.Connection.close() -> NoneClose the connection and the underlying HTTP client.
method
logfire.db_api.Connection.commit() -> NoneNo-op (read-only connection).
method
logfire.db_api.Connection.cursor() -> CursorCreate a new cursor associated with this connection.
method
logfire.db_api.Connection.rollback() -> NoneNo-op (read-only connection).
method
logfire.db_api.Cursor.close() -> NoneMark the cursor as closed.
method
logfire.db_api.Cursor.execute(operation:str, parameters:dict[str, Any] | Sequence[Any] | None=None) -> NoneExecute a SQL query.
method
logfire.db_api.Cursor.executemany(operation:str, seq_of_parameters:Sequence[dict[str, Any] | Sequence[Any]]) -> NoneExecute the same query with each set of parameters.
method
logfire.db_api.Cursor.fetchall() -> list[tuple[Any, ...]]Fetch all remaining rows.
method
logfire.db_api.Cursor.fetchmany(size:int | None=None) -> list[tuple[Any, ...]]Fetch the next `size` rows (default: `arraysize`).
method
logfire.db_api.Cursor.setinputsizes(_sizes:Any) -> NoneNo-op (PEP 249 optional).
method
logfire.db_api.Cursor.setoutputsize(_size:Any, _column:Any=None) -> NoneNo-op (PEP 249 optional).
class
logfire.db_api.DatabaseErrorException raised for errors related to the database.
class
logfire.db_api.ErrorBase class for all DB API errors.
class
logfire.db_api.InterfaceErrorException raised for errors related to the database interface.
class
logfire.db_api.NotSupportedErrorException raised when an unsupported operation is attempted.
class
logfire.db_api.ProgrammingErrorException raised for programming errors, e.g.
class
logfire.db_api.WarningException raised for important warnings, e.g.
class
logfire.exceptions.LogfireConfigErrorError raised when there is a problem with the Logfire configuration.
func
logfire.experimental.annotations.record_feedback(traceparent:str, name:str, value:int | float | bool | str, comment:str | None=None, extra:dict[str, Any] | None=None) -> NoneAttach feedback to a span.
class
logfire.experimental.api_client.AsyncLogfireAPIClientAsynchronous client for managing Logfire datasets.
method
logfire.experimental.api_client.AsyncLogfireAPIClient.add_cases(dataset_id_or_name:str, cases:Sequence[Case[InputsT, OutputT, MetadataT]] | Sequence[CaseData], *on_conflict:str='update') -> list[CaseDetail]Add cases to a dataset.
method
logfire.experimental.api_client.AsyncLogfireAPIClient.delete_case(dataset_id_or_name:str, case_id:str) -> NoneDelete a case from a dataset.
method
logfire.experimental.api_client.AsyncLogfireAPIClient.delete_dataset(id_or_name:str) -> NoneDelete a dataset.
method
logfire.experimental.api_client.AsyncLogfireAPIClient.get_case(dataset_id_or_name:str, case_id:str) -> CaseDetailGet a specific case from a dataset.
method
logfire.experimental.api_client.AsyncLogfireAPIClient.list_cases(dataset_id_or_name:str) -> list[CaseDetail]List all cases in a dataset.
method
logfire.experimental.api_client.AsyncLogfireAPIClient.list_datasets() -> list[DatasetSummary]List all datasets.
class
logfire.experimental.api_client.CaseDataData for creating a case via `LogfireAPIClient.add_cases`.
class
logfire.experimental.api_client.CaseNotFoundErrorRaised when a case is not found.
class
logfire.experimental.api_client.DatasetApiErrorRaised when the API returns an error.
class
logfire.experimental.api_client.DatasetDetailFull dataset metadata.
class
logfire.experimental.api_client.DatasetNotFoundErrorRaised when a dataset is not found.
class
logfire.experimental.api_client.ExportedDatasetDataset export in pydantic-evals-compatible format.
class
logfire.experimental.api_client.LogfireAPIClientSynchronous client for managing Logfire datasets.
method
logfire.experimental.api_client.LogfireAPIClient.add_cases(dataset_id_or_name:str, cases:Sequence[Case[InputsT, OutputT, MetadataT]] | Sequence[CaseData], *on_conflict:str='update') -> list[CaseDetail]Add cases to a dataset.
method
logfire.experimental.api_client.LogfireAPIClient.delete_case(dataset_id_or_name:str, case_id:str) -> NoneDelete a case from a dataset.
method
logfire.experimental.api_client.LogfireAPIClient.delete_dataset(id_or_name:str) -> NoneDelete a dataset and all its cases.
method
logfire.experimental.api_client.LogfireAPIClient.get_case(dataset_id_or_name:str, case_id:str) -> CaseDetailGet a specific case from a dataset.
method
logfire.experimental.api_client.LogfireAPIClient.list_cases(dataset_id_or_name:str) -> list[CaseDetail]List all cases in a dataset.
method
logfire.experimental.api_client.LogfireAPIClient.list_datasets() -> list[DatasetSummary]List all datasets in the project.
class
logfire.experimental.query_client.AsyncLogfireQueryClientAn asynchronous client for querying Logfire data.
method
logfire.experimental.query_client.AsyncLogfireQueryClient.info() -> ReadTokenInfoGet information about the read token.
class
logfire.experimental.query_client.LogfireQueryClientA synchronous client for querying Logfire data.
method
logfire.experimental.query_client.LogfireQueryClient.info() -> ReadTokenInfoGet information about the read token.
class
logfire.experimental.query_client.QueryExecutionErrorRaised when the query execution fails on the server.
class
logfire.experimental.query_client.QueryRequestErrorRaised when the query request is invalid.
class
logfire.experimental.query_client.QueryResultsThe (column-oriented) results of a JSON-format query.
class
logfire.experimental.query_client.ReadTokenInfoInformation about the read token.
class
logfire.experimental.query_client.RowQueryResultsThe row-oriented results of a JSON-format query.
class
logfire.integrations.flask.CommenterOptionsThe `commenter_options` parameter for `instrument_flask`.
class
logfire.integrations.httpx.RequestInfoInformation about an HTTP request.
class
logfire.integrations.httpx.ResponseInfoInformation about an HTTP response.
class
logfire.integrations.loguru.LogfireHandlerA loguru handler that sends logs to **Logfire**.
method
logfire.integrations.loguru.LogfireHandler.fill_attributes(record:LogRecord) -> dict[str, Any]Fill attributes from a log record.
class
logfire.integrations.pydantic.LogfirePydanticPluginImplements a new API for pydantic plugins.
class
logfire.integrations.pydantic.LogfireSettingsSettings for the logfire integration.
class
logfire.integrations.pydantic.PluginSettingsA typed dict for the Pydantic plugin settings.
func
logfire.integrations.pydantic.get_pydantic_plugin_config() -> PydanticPluginGet the Pydantic plugin config.
func
logfire.integrations.pydantic.get_schema_name(schema:CoreSchema) -> strFind the best name to use for a schema.
func
logfire.integrations.pydantic.set_pydantic_plugin_config(plugin_config:PydanticPlugin | None) -> NoneSet the pydantic plugin config.
class
logfire.integrations.redis.RequestHookA hook that is called before the request is sent.
class
logfire.integrations.redis.ResponseHookA hook that is called after the response is received.
func
logfire.loguru_handler() -> AnyCreate a **Logfire** handler for Loguru.
class
logfire.propagate.WrapperPropagatorHelper base class to wrap another propagator.
method
logfire.testing.IncrementalIdGenerator.generate_span_id() -> intGenerates a span id.
method
logfire.testing.IncrementalIdGenerator.generate_trace_id() -> intGenerates a trace id.
method
logfire.testing.IncrementalIdGenerator.reset_trace_span_ids() -> NoneResets the trace and span ids.
class
logfire.testing.TimeGeneratorGenerate incrementing timestamps for testing.
func
logfire.testing.capfire() -> CaptureLogfireA fixture that returns a CaptureLogfire instance.
func
logfire.testing.get_collected_metrics(metrics_reader:InMemoryMetricReader) -> list[dict[str, Any]]Get the collected metrics as a list of dictionaries.
class
logfire.types.ExceptionCallbackHelperHelper object passed to the exception callback.
method
logfire.types.ExceptionCallbackHelper.create_issue() -> boolWhether to create an issue for this exception.
class
logfire.types.ServerResponseCallbackHelperHelper object passed to the server response callback.
class
logfire.types.SpanLevelA convenience class for comparing span/log levels.
method
logfire.types.SpanLevel.from_span(span:ReadableSpan) -> SpanLevelCreate a SpanLevel from an OpenTelemetry span.
func
logfire.variables._handlebars.extract_composition_dependencies(template:str) -> frozenset[str]Return the top-level `@{name}@` references in *template*.
class
logfire.variables.abstract.ValidationReportReport of variable validation results.
method
logfire.variables.abstract.ValidationReport.format(*colors:bool=True) -> strFormat the validation report for human-readable output.
method
logfire.variables.abstract.ValidationReport.has_errors() -> boolReturn True if there are any validation errors.
class
logfire.variables.abstract.VariableChangeRepresents a change to be made to a variable.
class
logfire.variables.abstract.VariableDiffRepresents the diff between local and server variables.
method
logfire.variables.abstract.VariableDiff.has_changes() -> boolReturn True if there are any changes to apply.
class
logfire.variables.abstract.VariableNotFoundErrorRaised when a variable is not found.
class
logfire.variables.abstract.VariableProviderAbstract base class for variable value providers.
method
logfire.variables.abstract.VariableProvider.batch_update(updates:dict[str, VariableConfig | None]) -> NoneUpdate multiple variables atomically.
method
logfire.variables.abstract.VariableProvider.create_variable(config:VariableConfig) -> VariableConfigCreate a new variable configuration.
method
logfire.variables.abstract.VariableProvider.delete_variable(name:str) -> NoneDelete a variable configuration.
method
logfire.variables.abstract.VariableProvider.get_all_variables_config() -> VariablesConfigRetrieve all variable configurations.
method
logfire.variables.abstract.VariableProvider.get_variable_config(name:str) -> VariableConfig | NoneRetrieve the full configuration for a variable.
method
logfire.variables.abstract.VariableProvider.get_variable_type(name:str) -> VariableTypeConfig | NoneGet a variable type by name.
method
logfire.variables.abstract.VariableProvider.list_variable_types() -> dict[str, VariableTypeConfig]List all variable types from the provider.
method
logfire.variables.abstract.VariableProvider.push_config(config:VariablesConfig, *mode:SyncMode='merge', *dry_run:bool=False, *yes:bool=False) -> boolPush a VariablesConfig to this provider.
method
logfire.variables.abstract.VariableProvider.push_variables(variables:Sequence[Variable[object]], *dry_run:bool=False, *yes:bool=False, *strict:bool=False) -> boolPush variable definitions to this provider.
method
logfire.variables.abstract.VariableProvider.refresh(force:bool=False)Refresh the value provider.
method
logfire.variables.abstract.VariableProvider.start(logfire_instance:logfire.Logfire | None) -> NoneStart any background tasks for this provider.
method
logfire.variables.abstract.VariableProvider.update_variable(name:str, config:VariableConfig) -> VariableConfigUpdate an existing variable configuration.
method
logfire.variables.abstract.VariableProvider.upsert_variable_type(config:VariableTypeConfig) -> VariableTypeConfigCreate or update a variable type.
class
logfire.variables.abstract.VariableWriteErrorBase exception for variable write operation failures.
func
logfire.variables.abstract.render_serialized_string(serialized_json:str, inputs:Any) -> strRender Handlebars templates in a serialized JSON string.
func
logfire.variables.composition.has_references(serialized_value:str) -> boolQuick check for any `@{` in a serialized value.
method
logfire.variables.config.KeyIsNotPresent.matches(attributes:Mapping[str, Any]) -> boolCheck if the attribute key does not exist in the attributes.
class
logfire.variables.config.KeyIsPresentCondition that matches when an attribute key is present.
method
logfire.variables.config.KeyIsPresent.matches(attributes:Mapping[str, Any]) -> boolCheck if the attribute key exists in the attributes.
class
logfire.variables.config.LatestVersionThe latest (highest) version of the variable.
class
logfire.variables.config.RolloutConfiguration for label selection with weighted probabilities.
class
logfire.variables.config.VariablesConfigContainer for all managed variable configurations.
method
logfire.variables.config.VariablesConfig.merge(other:VariablesConfig) -> VariablesConfigMerge another VariablesConfig into this one.
func
logfire.variables.config.get_default_type_name(t:Any) -> strGet the default name for a Python type.
func
logfire.variables.config.get_source_hint(t:Any) -> str | NoneGet a source hint for a type based on its module and qualname.
class
logfire.variables.template_validation.TemplateValidationResultResult of template composition validation.
class
logfire.variables.variable.TemplateVariableA managed variable with integrated template rendering.
method
logfire.variables.variable.Variable.refresh(force:bool=False)Asynchronously refresh the variable.
method
logfire.variables.variable.Variable.refresh_sync(force:bool=False)Synchronously refresh the variable.
method
logfire.variables.variable.Variable.to_config() -> VariableConfigCreate a VariableConfig from this Variable instance.
func
logfire.variables.variable.is_resolve_function(f:Any) -> TypeIs[ResolveFunction[Any]]Check if a callable matches the ResolveFunction signature.
func
release.prepare.generate_stubs() -> NoneRun make logic to generate stubs and update __init__.pyi.
func
release.prepare.get_last_tag() -> strGet the latest tag from the Git repository.
func
release.prepare.get_notes(new_version:str) -> strGenerate release notes from GitHub's release notes generator.
func
release.prepare.update_history(new_version:str, notes:str) -> NoneUpdate CHANGELOG.md with the new release notes.
func
release.prepare.update_version(pyproject_file:str, new_version:str) -> NoneUpdate the version in a given pyproject.toml.
func
release.push.commit_and_push_changes(version:str) -> NoneCommit and push changes to a new branch.
func
release.push.create_github_release_draft(version:str, release_notes:str)Create a GitHub release draft.
func
release.push.open_pull_request(version:str)Open a pull request on GitHub.
func
release.shared.run_command(*args:str) -> strRun a shell command and return the output.
About this data
These signatures were extracted from the public source of pydantic/logfire
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.