Repository navigation
feat(api): update API spec from langfuse/langfuse 14986f6 #2049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |
| from .scim.client import AsyncScimClient, ScimClient | ||
| from .score_configs.client import AsyncScoreConfigsClient, ScoreConfigsClient | ||
| from .scores.client import AsyncScoresClient, ScoresClient | ||
| from .skills.client import AsyncSkillsClient, SkillsClient | ||
| from .trace.client import AsyncTraceClient, TraceClient | ||
| from .unstable.client import AsyncUnstableClient, UnstableClient | ||
|
|
||
|
|
@@ -147,6 +148,7 @@ def __init__( | |
| self._scim: typing.Optional[ScimClient] = None | ||
| self._score_configs: typing.Optional[ScoreConfigsClient] = None | ||
| self._scores: typing.Optional[ScoresClient] = None | ||
| self._skills: typing.Optional[SkillsClient] = None | ||
| self._trace: typing.Optional[TraceClient] = None | ||
| self._unstable: typing.Optional[UnstableClient] = None | ||
|
|
||
|
|
@@ -352,6 +354,14 @@ def scores(self): | |
| self._scores = ScoresClient(client_wrapper=self._client_wrapper) | ||
| return self._scores | ||
|
|
||
| @property | ||
| def skills(self): | ||
| if self._skills is None: | ||
| from .skills.client import SkillsClient # noqa: E402 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new Rule Used: Move imports to the top of the module instead of placing them within functions or methods. (source) Learned From Prompt To Fix With AIThis is a comment left during a code review.
Path: langfuse/api/client.py
Line: 360
Comment:
**Imports break the repository rule**
The new `skills` properties import their clients inside methods. The repository requires imports at the top of the module instead. Move these imports to module scope before merging. The async `skills` property and the `topics` properties in `langfuse/api/unstable/client.py` repeat this pattern.
**Rule Used:** Move imports to the top of the module instead of placing them within functions or methods. ([source](https://app.greptile.com/personal-org-4986/-/custom-context?memory=c960fc07-9928-409f-a18b-a780cbdded12))
**Learned From**
[langfuse/langfuse-python#1387](https://github.com/langfuse/langfuse-python/pull/1387)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
|
|
||
| self._skills = SkillsClient(client_wrapper=self._client_wrapper) | ||
| return self._skills | ||
|
|
||
| @property | ||
| def trace(self): | ||
| if self._trace is None: | ||
|
|
@@ -472,6 +482,7 @@ def __init__( | |
| self._scim: typing.Optional[AsyncScimClient] = None | ||
| self._score_configs: typing.Optional[AsyncScoreConfigsClient] = None | ||
| self._scores: typing.Optional[AsyncScoresClient] = None | ||
| self._skills: typing.Optional[AsyncSkillsClient] = None | ||
| self._trace: typing.Optional[AsyncTraceClient] = None | ||
| self._unstable: typing.Optional[AsyncUnstableClient] = None | ||
|
|
||
|
|
@@ -685,6 +696,14 @@ def scores(self): | |
| self._scores = AsyncScoresClient(client_wrapper=self._client_wrapper) | ||
| return self._scores | ||
|
|
||
| @property | ||
| def skills(self): | ||
| if self._skills is None: | ||
| from .skills.client import AsyncSkillsClient # noqa: E402 | ||
|
|
||
| self._skills = AsyncSkillsClient(client_wrapper=self._client_wrapper) | ||
| return self._skills | ||
|
|
||
| @property | ||
| def trace(self): | ||
| if self._trace is None: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two new required arguments break existing calls to
BlobStorageExportFieldGroup.visit(), even for unchanged values such asCORE. A caller supplying all eleven callbacks required before this PR now getsTypeErrorbefore its callback runs. Make the new callbacks optional and check them only when visiting the new score groups.Prompt To Fix With AI