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

feat: return source metadata with list sources route #1164

Merged
merged 4 commits into from
Mar 19, 2024

Conversation

cpacker
Copy link
Owner

@cpacker cpacker commented Mar 18, 2024

GET http://localhost:8283/api/sources now returns metadata along with source information.

NOTE @sarahwooders : embedding_config and description fields are currently bugged until Source is deprecated in favor of pydantic SourceModel throughout the code (punting to separate PR).

GET http://localhost:8283/api/sources
{
	"sources": [
		{
			"name": "custom-source",
			"description": null,
			"user_id": "00000000-0000-0000-0000-000000000000",
			"created_at": "2024-03-17T16:48:54.418499",
			"id": "01e0035f-c506-4f3b-adfc-6ed920725de2",
			"embedding_config": {
				"embedding_endpoint_type": "openai",
				"embedding_endpoint": "https://api.openai.com/v1",
				"embedding_model": "text-embedding-ada-002",
				"embedding_dim": 1536,
				"embedding_chunk_size": 300
			},
			"source_metadata": {
				"num_documents": 0,
				"num_passages": 0
			}
		},

Have you tested this PR?

- [ ] Replace num_documents / num_passages placeholder values with real data

  • -> future PR

@cpacker cpacker added the API Related to MemGPT API label Mar 18, 2024
Copy link
Collaborator

@sarahwooders sarahwooders left a comment

Choose a reason for hiding this comment

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

LGTM!

list_data_source_passages should be paginated, but we can fix that when it gets actually implemented.

@cpacker cpacker merged commit 1c25a80 into main Mar 19, 2024
4 checks passed
@cpacker cpacker deleted the update-list-sources-route branch March 19, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Related to MemGPT API
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants