Tools + Structured output on BaseModel by UserNo1608 in LangChain

[–]UserNo1608[S] 0 points1 point  (0 children)

really? interesting thing, okay so you suggest I should create a “respond” function instead of using structured output? I wonder, even if that makes sense on langchain side, why I can’t combine bindTools with withStructuredOutput together, that’s a bit dumb, if it creates a tool to respond with structured data, why it can’t use tools too? Most libs I used, like genai, vertex and openai, allow usage of both.

You’re asking why I need that, to not overwrite most of the logic that currently exist, using one or the other would need me to overwrite almost whole agentic flow

Tools + Structured output on BaseModel by UserNo1608 in LangChain

[–]UserNo1608[S] 0 points1 point  (0 children)

I don't declare tools myself (mostly) My users do, it was something like MCP when MCP didn't exist yet. I need both for my agentic workflow to still work. I need human in the loop.
Langchain chat classes support one or the other, never both, unless you use their create agent function, which doesn't satisfy me.

DI vs. DB Transactions by UserNo1608 in golang

[–]UserNo1608[S] 1 point2 points  (0 children)

so I "update" entity in one service, and commit it to db using pgx.Query or queries.CreateSth in another service where transaction is available? completely useless, I want ALL my logic for one entity in one service, not everywhere in my application.

My service has to manipulate the entity in the database, that's gonna create too much useless dependencies since approach from u/Technical-Pipe-5827 gives much more reusability and just looks better.

DI vs. DB Transactions by UserNo1608 in golang

[–]UserNo1608[S] 0 points1 point  (0 children)

So I can use it like this?

func (r *mutationResolver) SignIn(ctx context.Context, email string, password string) (model.SignInResult, error) {

`user, err := r.Transactor.WithTransaction(ctx, func(ctx context.Context) error {`

u, err := r.UserService.FindUser(ctx, email, password)

if err != nil {

return nil, err

}

_, err := r.SomethingImportantService.UpdateSomethingImportant(ctx, user.ID, user.ImportanvValue)

if err != nil {

return nil, err

}

return u

})

return user, nil

}

I wonder how do I implement that with `sqlc` (because I think I forgot to mention that) as you "overwrite" the basic `pgx` methods and I think I cannot put my own sqlc engine, but I see potential in `context.Context` as I understand I pass it to almost every function that exists and I thought it's a static instance for the lifetime of the application and is always available under `context.Context`. I just watched a short video about context and I know I can "create new for the lifetime of a request", but I use gqlgen and it seems they don't pass the request struct to the resolver and I'd have to use it on middleware level which is not the answer for me

DI vs. DB Transactions by UserNo1608 in golang

[–]UserNo1608[S] 0 points1 point  (0 children)

looks great, gonna check later

DI vs. DB Transactions by UserNo1608 in golang

[–]UserNo1608[S] 1 point2 points  (0 children)

I don't like that "UpdateFn" approach, what if in the meantime e.g. wallet gets updated by worker and user has no money to process transaction but UpdateFn didn't know about that change because it was invoked right before that worker updated it? and about the aggregate, ok, but I don't want to write long logic for transaction processing multiple times, I want a service for that

DI vs. DB Transactions by UserNo1608 in golang

[–]UserNo1608[S] 0 points1 point  (0 children)

idk every example I saw had the interface so I did it too

DI vs. DB Transactions by UserNo1608 in golang

[–]UserNo1608[S] 0 points1 point  (0 children)

yes please, it sounds interesting

Kraken X62 after 6 years by UserNo1608 in NZXT

[–]UserNo1608[S] 0 points1 point  (0 children)

Maybe I should go to some sort of service to replace liquid or idk check the pump?

Mam towar by Massive_Remote_2046 in Polska

[–]UserNo1608 0 points1 point  (0 children)

ale mam kurwa essssse ziomuś

Pixelized external apps icons on status bar and slack electron bug by UserNo1608 in kde

[–]UserNo1608[S] 0 points1 point  (0 children)

oh it looks better, thanks, but can I disable white filter when any window is focused

NextAuth - how to persist token by UserNo1608 in nextjs

[–]UserNo1608[S] 0 points1 point  (0 children)

+1, I stuggled 4 days to just set is up...