This file contains hidden or 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
| #!/usr/bin/env bash | |
| # qdrant-search - Semantic search powered by Qdrant + LM Studio embeddings | |
| set -euo pipefail | |
| QDRANT_URL="${QDRANT_URL:-http://localhost:6333}" | |
| LMS_URL="${LMS_URL:-http://localhost:1234}" | |
| EMBED_MODEL="${EMBED_MODEL:-text-embedding-nomic-embed-text-v1.5}" | |
| EMBED_DIMS="${EMBED_DIMS:-768}" | |
| BATCH_SIZE="${BATCH_SIZE:-200}" | |
| PARALLEL="${PARALLEL:-1}" |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # moltbook - CLI for searching Moltbook (social network for AI agents) | |
| set -euo pipefail | |
| API_BASE="https://www.moltbook.com/api/v1" | |
| CONFIG_DIR="${HOME}/.config/moltbook" | |
| CONFIG_FILE="${CONFIG_DIR}/config" | |
| INDEX_FILE="${CONFIG_DIR}/index.json" | |
| QDRANT_SEARCH="$(dirname "$0")/qdrant-search" | |
| QDRANT_COLLECTION="moltbook-posts" |
This file contains hidden or 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
| public static class TagWithExtensions | |
| { | |
| public static IQueryable<T> TagWithContext<T>(this IQueryable<T> queryable, string? message = "", [CallerFilePath] string callerFileName = "", [CallerMemberName] string callerName = "") | |
| { | |
| string logScopeName = GenerateLogScopeName(message, callerFileName, callerName); | |
| return queryable.TagWith(logScopeName); | |
| } | |
| private static string GenerateLogScopeName(string? message = null, string callerFileName = "", string callerName = "") | |
| { |
This file contains hidden or 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
| public async Task InsertTweetStoreProc(string username, string message, CancellationToken ct = default) | |
| { | |
| using (_logger.BeginScope(new Dictionary<string, object> { { "EFQueries", "GetTweetsLog" } })) | |
| { | |
| _ = await _context.Database | |
| .ExecuteSqlRawAsync( | |
| "InsertTweet @Username, @Message", | |
| new SqlParameter("Username", username), | |
| new SqlParameter("Message", message)); | |
| } |
This file contains hidden or 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
| @EventType = 0xE9507561 |
This file contains hidden or 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
| public async Task InsertTweetStoreProc(string username, string message, CancellationToken ct = default) | |
| { | |
| using (_logger.BeginScope(new Dictionary<string, object> { { "EFQueries", "InsertTweetStoreProc" } })) | |
| { | |
| _ = await _context.Database | |
| .ExecuteSqlRawAsync( | |
| "InsertTweet @Username, @Message", | |
| new SqlParameter("Username", username), | |
| new SqlParameter("Message", message)); | |
| } |
This file contains hidden or 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
| param( | |
| [Parameter()] | |
| [ValidateNotNullOrEmpty()] | |
| [string] $ResourceGroup = $null, | |
| [Parameter()] | |
| [ValidateNotNullOrEmpty()] | |
| [string] $ResourceLocation = 'EastUS', | |
| # F0 is free and S0 is paid SKU |
This file contains hidden or 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
| public async Task<IEnumerable<Tweet>> GetTweetsWithExtraLogs(CancellationToken ct = default) | |
| { | |
| using (_logger.BeginScope(new Dictionary<string, object> { { "EFQueries", "GetTweetsLog" } })) | |
| { | |
| return await _context.Tweets | |
| .TagWith("GetTweets + LogContext") | |
| .ToListAsync(ct) | |
| .ConfigureAwait(false); | |
| } | |
| } |
This file contains hidden or 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
| public Task InsertTweetStoreProc(string username, string message, CancellationToken ct = default) | |
| { | |
| using (_logger.BeginScope(new Dictionary<string, object> { { "EFQueries", "InsertTweetStoreProc" } })) | |
| { | |
| _ = _context.Tweets | |
| .FromSqlRaw( | |
| "InsertTweet @Username, @Message", | |
| new SqlParameter("Username", username), | |
| new SqlParameter("Message", message)) | |
| // A hack to make STORE PROC work when they don't return anything. |
This file contains hidden or 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
| public async Task InsertTweet(string username, string message, CancellationToken ct = default) | |
| { | |
| using (_logger.BeginScope(new Dictionary<string, object> { { "EFQueries", "InsertTweet" } })) | |
| { | |
| _context.Tweets.Add(new Tweet | |
| { | |
| Username = username, | |
| Message = message, | |
| CreatedUtc = DateTime.UtcNow | |
| }); |
NewerOlder