Skip to content
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

sdk-py: added Cron search functionality #804

Merged
merged 28 commits into from
Jun 28, 2024

Conversation

isahers1
Copy link
Contributor

No description provided.

elif assistant_id:
return await self.http.get(f"/assistants/{assistant_id}/runs/crons")
else:
return await self.http.get(f"runs/crons")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assistant_id should be required for cron also (similar to run)

@isahers1 isahers1 marked this pull request as ready for review June 25, 2024 17:51
@@ -687,6 +687,20 @@ async def create(
async def delete(self, cron_id: str) -> None:
"""Delete a cron."""
await self.http.delete(f"/runs/crons/{cron_id}")

async def list(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you call this search

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@akira akira requested a review from nfcampos June 25, 2024 20:46
"thread_id": thread_id,
}
payload = {k: v for k, v in payload.items() if v is not None}
return await self.http.post(f"/runs/crons/search", json=payload)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need f"" since there's no replacements

@@ -412,8 +412,7 @@ def stream(
interrupt_after: Optional[list[str]] = None,
feedback_keys: Optional[list[str]] = None,
multitask_strategy: Optional[MultitaskStrategy] = None,
) -> AsyncIterator[StreamPart]:
...
) -> AsyncIterator[StreamPart]: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing the lint error. The ellipse (...) should be on a new line. Undo this change and all of the other instances and you should be good to go!

) -> AsyncIterator[StreamPart]:
    ...

@isahers1 isahers1 changed the title corresponding pr for api, added list endpoints for cron sdk-py: added Cron search functionality Jun 27, 2024
@andrewnguonly andrewnguonly merged commit 1fe13cb into langchain-ai:main Jun 28, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants